added dynamic status icons for almost all the modules, also alpha patch for dwm and more

This commit is contained in:
Clay Gomera 2023-05-27 00:52:32 -04:00
parent 34e06fcc7f
commit 057c11dc56
22 changed files with 601 additions and 799 deletions

View file

@ -233,5 +233,63 @@ alias \
wfi-off="nmcli radio wifi off" \
blt="bluetoothctl"
### SETTING THE STARSHIP PROMPT ###
eval "$(starship init bash)"
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo "[${BRANCH}${STAT}]"
else
echo ""
fi
}
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
STAT=`parse_git_dirty`
echo "[${BRANCH}${STAT}]"
else
echo ""
fi
}
# get current status of git repo
function parse_git_dirty {
status=`git status 2>&1 | tee`
dirty=`echo -n "${status}" 2> /dev/null | grep "modified:" &> /dev/null; echo "$?"`
untracked=`echo -n "${status}" 2> /dev/null | grep "Untracked files" &> /dev/null; echo "$?"`
ahead=`echo -n "${status}" 2> /dev/null | grep "Your branch is ahead of" &> /dev/null; echo "$?"`
newfile=`echo -n "${status}" 2> /dev/null | grep "new file:" &> /dev/null; echo "$?"`
renamed=`echo -n "${status}" 2> /dev/null | grep "renamed:" &> /dev/null; echo "$?"`
deleted=`echo -n "${status}" 2> /dev/null | grep "deleted:" &> /dev/null; echo "$?"`
bits=''
if [ "${renamed}" == "0" ]; then
bits=">${bits}"
fi
if [ "${ahead}" == "0" ]; then
bits="*${bits}"
fi
if [ "${newfile}" == "0" ]; then
bits="+${bits}"
fi
if [ "${untracked}" == "0" ]; then
bits="?${bits}"
fi
if [ "${deleted}" == "0" ]; then
bits="x${bits}"
fi
if [ "${dirty}" == "0" ]; then
bits="!${bits}"
fi
if [ ! "${bits}" == "" ]; then
echo " ${bits}"
else
echo ""
fi
}
export PS1="[\[\e[31m\]\u\[\e[m\]\[\e[35m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\]] [\[\e[33m\]\W\[\e[m\]\[\e[34m\]\`parse_git_branch\`\[\e[m\]] 󱞪 "

View file

@ -1,141 +1,44 @@
--[[
THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
`lvim` is the global options object
]]
-- vim options
-- nvim options
vim.opt.shiftwidth = 2
vim.opt.tabstop = 2
vim.opt.relativenumber = true
vim.cmd('autocmd FileType markdown setlocal nospell')
vim.opt.wrap = true -- wrap lines
vim.opt.spell = false
vim.o.shell = '/usr/bin/bash'
-- general
vim.opt.spell = false
vim.o.shell = '/usr/bin/fish'
lvim.use_icons = false
lvim.log.level = "info"
lvim.format_on_save = {
enabled = true,
pattern = "*.lua",
timeout = 1000,
}
-- to disable icons and use a minimalist setup, uncomment the following
-- lvim.use_icons = false
-- keymappings <https://www.lunarvim.org/docs/configuration/keybindings>
lvim.leader = "space"
-- add your own keymapping
lvim.keys.normal_mode["<C-s>"] = ":w<cr>"
-- lvim.keys.normal_mode["<S-l>"] = ":BufferLineCycleNext<CR>"
-- lvim.keys.normal_mode["<S-h>"] = ":BufferLineCyclePrev<CR>"
-- -- Use which-key to add extra bindings with the leader-key prefix
-- lvim.builtin.which_key.mappings["W"] = { "<cmd>noautocmd w<cr>", "Save without formatting" }
-- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
-- -- Change theme settings
-- change theme settings
lvim.colorscheme = "gruvbox"
lvim.transparent_window = true
lvim.builtin.alpha.active = true
lvim.builtin.alpha.mode = "dashboard"
lvim.builtin.terminal.active = true
lvim.builtin.nvimtree.setup.view.side = "left"
lvim.builtin.nvimtree.setup.renderer.icons.show.git = false
-- Automatically install missing parsers when entering buffer
-- automatically install missing parsers when entering buffer
lvim.builtin.treesitter.auto_install = true
-- if you don't want all the parsers change this to a table of the ones you want
lvim.builtin.treesitter.ensure_installed = {
"bash",
"c_sharp",
"lua",
"python",
"css",
"latex",
"yaml",
"toml",
}
-- lvim.builtin.treesitter.ignore_install = { "haskell" }
-- -- always installed on startup, useful for parsers without a strict filetype
-- lvim.builtin.treesitter.ensure_installed = { "comment", "markdown_inline", "regex" }
-- -- generic LSP settings <https://www.lunarvim.org/docs/languages#lsp-support>
-- --- disable automatic installation of servers
-- lvim.lsp.installer.setup.automatic_installation = false
-- ---configure a server manually. IMPORTANT: Requires `:LvimCacheReset` to take effect
-- ---see the full default list `:lua =lvim.lsp.automatic_configuration.skipped_servers`
-- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" })
-- local opts = {} -- check the lspconfig documentation for a list of all possible options
-- require("lvim.lsp.manager").setup("pyright", opts)
-- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. IMPORTANT: Requires `:LvimCacheReset` to take effect
-- ---`:LvimInfo` lists which server(s) are skipped for the current filetype
-- lvim.lsp.automatic_configuration.skipped_servers = vim.tbl_filter(function(server)
-- return server ~= "emmet_ls"
-- end, lvim.lsp.automatic_configuration.skipped_servers)
-- -- you can set a custom on_attach function that will be used for all the language servers
-- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
-- lvim.lsp.on_attach_callback = function(client, bufnr)
-- local function buf_set_option(...)
-- vim.api.nvim_buf_set_option(bufnr, ...)
-- end
-- --Enable completion triggered by <c-x><c-o>
-- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
-- end
-- -- linters and formatters <https://www.lunarvim.org/docs/languages#lintingformatting>
-- local formatters = require "lvim.lsp.null-ls.formatters"
-- formatters.setup {
-- { command = "stylua" },
-- {
-- command = "prettier",
-- extra_args = { "--print-width", "100" },
-- filetypes = { "typescript", "typescriptreact" },
-- },
-- }
-- local linters = require "lvim.lsp.null-ls.linters"
-- linters.setup {
-- { command = "flake8", filetypes = { "python" } },
-- {
-- command = "shellcheck",
-- args = { "--severity", "warning" },
-- },
-- }
-- Additional Plugins
-- additional Plugins
lvim.plugins = {
{ "lunarvim/colorschemes" },
{ "ellisonleao/gruvbox.nvim" },
{ "puremourning/vimspector" },
{
"iamcco/markdown-preview.nvim",
build = "cd app && npm install",
ft = "markdown",
config = function()
vim.g.mkdp_auto_start = 1
end,
},
{ "OmniSharp/omnisharp-vim" },
{ "SirVer/ultisnips" },
}
-- Plugin options
-- vimspector options
vim.g.vimspector_enable_mappings = 'HUMAN'
vim.g.vimspector_enable_mappings_for_mode = {
['<leader><leader>'] = { 'n', 'v' },
}
-- -- Autocommands (`:help autocmd`) <https://neovim.io/doc/user/autocmd.html>
-- vim.api.nvim_create_autocmd("FileType", {
-- pattern = "zsh",
-- callback = function()
-- -- let treesitter use bash highlight for zsh files as well
-- require("nvim-treesitter.highlight").attach(0, "bash")
-- end,
-- })

View file

@ -1,12 +0,0 @@
https://khanacademy.org/ khanacademy
https://mail.google.com/ gmail
https://mail.tutanota.com/ tutanota
https://youtube.com/ youtube
https://fosstodon.org/ mastodon
https://pixelfed.social/ pixelfed
https://github.com/ github
https://app.element.io/ element
https://web.whatsapp.com/ whatsapp
https://outlook.office.com/ intec-correo
https://campusvirtual.intec.edu.do/ intec-aula-virtual
https://procesos.intec.edu.do/ intec-procesos

View file

@ -1,251 +0,0 @@
## ____ __
## / __ \_________ _/ /_____
## / / / / ___/ __ `/ //_/ _ \
## / /_/ / / / /_/ / ,< / __/ Clay Gomera (Drake)
## /_____/_/ \__,_/_/|_|\___/ My custom qutebrowser config
##
# Autogenerated config.py
#
# NOTE: config.py is intended for advanced users who are comfortable
# with manually migrating the config file on qutebrowser upgrades. If
# you prefer, you can also configure qutebrowser using the
# :set/:bind/:config-* commands without having to write a config.py
# file.
#
# Documentation:
# qute://help/configuring.html
# qute://help/settings.html
# Uncomment this to still load settings configured via autoconfig.yml
# config.load_autoconfig()
# Or uncomment this line to load settings from config.py
config.load_autoconfig(False)
# Aliases for commands. The keys of the given dictionary are the
# aliases, while the values are the commands they map to.
# Type: Dict
c.aliases = {'q': 'quit', 'w': 'session-save', 'wq': 'quit --save'}
# Setting dark mode
#config.set("colors.webpage.darkmode.enabled", True)
# Which cookies to accept. With QtWebEngine, this setting also controls
# other features with tracking capabilities similar to those of cookies;
# including IndexedDB, DOM storage, filesystem API, service workers, and
# AppCache. Note that with QtWebKit, only `all` and `never` are
# supported as per-domain values. Setting `no-3rdparty` or `no-
# unknown-3rdparty` per-domain on QtWebKit will have the same effect as
# `all`.
# Type: String
# Valid values:
# - all: Accept all cookies.
# - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail.
# - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty.
# - never: Don't accept cookies at all.
config.set('content.cookies.accept', 'all', 'chrome-devtools://*')
# Which cookies to accept. With QtWebEngine, this setting also controls
# other features with tracking capabilities similar to those of cookies;
# including IndexedDB, DOM storage, filesystem API, service workers, and
# AppCache. Note that with QtWebKit, only `all` and `never` are
# supported as per-domain values. Setting `no-3rdparty` or `no-
# unknown-3rdparty` per-domain on QtWebKit will have the same effect as
# `all`.
# Type: String
# Valid values:
# - all: Accept all cookies.
# - no-3rdparty: Accept cookies from the same origin only. This is known to break some sites, such as GMail.
# - no-unknown-3rdparty: Accept cookies from the same origin only, unless a cookie is already set for the domain. On QtWebEngine, this is the same as no-3rdparty.
# - never: Don't accept cookies at all.
config.set('content.cookies.accept', 'all', 'devtools://*')
# User agent to send. The following placeholders are defined: *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version. The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine. Note that the value
# read from JavaScript is always the global value. With QtWebEngine
# between 5.12 and 5.14 (inclusive), changing the value exposed to
# JavaScript requires a restart.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/{webkit_version} (KHTML, like Gecko) {upstream_browser_key}/{upstream_browser_version} Safari/{webkit_version}', 'https://web.whatsapp.com/')
# User agent to send. The following placeholders are defined: *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version. The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine. Note that the value
# read from JavaScript is always the global value. With QtWebEngine
# between 5.12 and 5.14 (inclusive), changing the value exposed to
# JavaScript requires a restart.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}; rv:71.0) Gecko/20100101 Firefox/71.0', 'https://accounts.google.com/*')
# User agent to send. The following placeholders are defined: *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version. The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine. Note that the value
# read from JavaScript is always the global value. With QtWebEngine
# between 5.12 and 5.14 (inclusive), changing the value exposed to
# JavaScript requires a restart.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99 Safari/537.36', 'https://*.slack.com/*')
# User agent to send. The following placeholders are defined: *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version. The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine. Note that the value
# read from JavaScript is always the global value. With QtWebEngine
# between 5.12 and 5.14 (inclusive), changing the value exposed to
# JavaScript requires a restart.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}; rv:71.0) Gecko/20100101 Firefox/71.0', 'https://docs.google.com/*')
# User agent to send. The following placeholders are defined: *
# `{os_info}`: Something like "X11; Linux x86_64". * `{webkit_version}`:
# The underlying WebKit version (set to a fixed value with
# QtWebEngine). * `{qt_key}`: "Qt" for QtWebKit, "QtWebEngine" for
# QtWebEngine. * `{qt_version}`: The underlying Qt version. *
# `{upstream_browser_key}`: "Version" for QtWebKit, "Chrome" for
# QtWebEngine. * `{upstream_browser_version}`: The corresponding
# Safari/Chrome version. * `{qutebrowser_version}`: The currently
# running qutebrowser version. The default value is equal to the
# unchanged user agent of QtWebKit/QtWebEngine. Note that the value
# read from JavaScript is always the global value. With QtWebEngine
# between 5.12 and 5.14 (inclusive), changing the value exposed to
# JavaScript requires a restart.
# Type: FormatString
config.set('content.headers.user_agent', 'Mozilla/5.0 ({os_info}; rv:71.0) Gecko/20100101 Firefox/71.0', 'https://drive.google.com/*')
# Load images automatically in web pages.
# Type: Bool
config.set('content.images', True, 'chrome-devtools://*')
# Load images automatically in web pages.
# Type: Bool
config.set('content.images', True, 'devtools://*')
# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'chrome-devtools://*')
# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'devtools://*')
# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'chrome://*/*')
# Enable JavaScript.
# Type: Bool
config.set('content.javascript.enabled', True, 'qute://*/*')
# Type: BoolAsk
# Valid values:
# - true
# - false
# - ask
# config.set('content.notifications.enabled', True, 'https://www.youtube.com')
# Directory to save downloads to. If unset, a sensible OS-specific
# default is used.
# Type: Directory
c.downloads.location.directory = '~/Downloads'
# When to show the tab bar.
# Type: String
# Valid values:
# - always: Always show the tab bar.
# - never: Always hide the tab bar.
# - multiple: Hide the tab bar if only one tab is open.
# - switching: Show the tab bar when switching tabs.
c.tabs.show = 'always'
# Setting default page for when opening new tabs or new windows with
# commands like :open -t and :open -w .
c.url.default_page = 'https://start.duckduckgo.com'
c.url.start_pages = 'https://start.duckduckgo.com'
# Search engines which can be used via the address bar. Maps a search
# engine name (such as `DEFAULT`, or `ddg`) to a URL with a `{}`
# placeholder. The placeholder will be replaced by the search term, use
# `{{` and `}}` for literal `{`/`}` braces. The following further
# placeholds are defined to configure how special characters in the
# search terms are replaced by safe characters (called 'quoting'): *
# `{}` and `{semiquoted}` quote everything except slashes; this is the
# most sensible choice for almost all search engines (for the search
# term `slash/and&amp` this placeholder expands to `slash/and%26amp`).
# * `{quoted}` quotes all characters (for `slash/and&amp` this
# placeholder expands to `slash%2Fand%26amp`). * `{unquoted}` quotes
# nothing (for `slash/and&amp` this placeholder expands to
# `slash/and&amp`). The search engine named `DEFAULT` is used when
# `url.auto_search` is turned on and something else than a URL was
# entered to be opened. Other search engines can be used by prepending
# the search engine name to the search term, e.g. `:open google
# qutebrowser`.
# Type: Dict
c.url.searchengines = {'DEFAULT': 'https://duckduckgo.com/?q={}', 'aw': 'https://wiki.archlinux.org/?search={}', 'ub': 'https://www.urbandictionary.com/define.php?term={}', 'wiki': 'https://en.wikipedia.org/wiki/{}'}
# Default font families to use. Whenever "default_family" is used in a
# font setting, it's replaced with the fonts listed here. If set to an
# empty value, a system-specific monospace default is used.
# Type: List of Font, or Font
c.fonts.default_family = '"mononoki Nerd Font"'
# Default font size to use. Whenever "default_size" is used in a font
# setting, it's replaced with the size listed here. Valid values are
# either a float value with a "pt" suffix, or an integer value with a
# "px" suffix.
# Type: String
c.fonts.default_size = '10pt'
# Font used in the completion widget.
# Type: Font
c.fonts.completion.entry = '10pt "mononoki Nerd Font"'
# Font used for the debugging console.
# Type: Font
c.fonts.debug_console = '10pt "mononoki Nerd Font"'
# Font used for prompts.
# Type: Font
c.fonts.prompts = 'default_size sans-serif'
# Font used in the statusbar.
# Type: Font
c.fonts.statusbar = '10pt "mononoki Nerd Font"'
config.source('gruvbox.py')
# Bindings for normal mode
config.bind('M', 'hint links spawn mpv {hint-url}')
config.bind('Z', 'hint links spawn st -e youtube-dl {hint-url}')
config.bind('t', 'set-cmd-text -s :open -t')
config.bind('xb', 'config-cycle statusbar.show always never')
config.bind('xt', 'config-cycle tabs.show always never')
config.bind('xx', 'config-cycle statusbar.show always never;; config-cycle tabs.show always never')

View file

@ -1,332 +0,0 @@
# gruvbox dark hard qutebrowser theme by Florian Bruhin <me@the-compiler.org>
#
# Originally based on:
# base16-qutebrowser (https://github.com/theova/base16-qutebrowser)
# Base16 qutebrowser template by theova and Daniel Mulford
# Gruvbox dark, hard scheme by Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
bg0_hard = "#1d2021"
bg0_soft = '#32302f'
bg0_normal = '#282828'
bg0 = bg0_normal
bg1 = "#3c3836"
bg2 = "#504945"
bg3 = "#665c54"
bg4 = "#7c6f64"
fg0 = "#fbf1c7"
fg1 = "#ebdbb2"
fg2 = "#d5c4a1"
fg3 = "#bdae93"
fg4 = "#a89984"
bright_red = "#fb4934"
bright_green = "#b8bb26"
bright_yellow = "#fabd2f"
bright_blue = "#83a598"
bright_purple = "#d3869b"
bright_aqua = "#8ec07c"
bright_gray = "#928374"
bright_orange = "#fe8019"
dark_red = "#cc241d"
dark_green = "#98971a"
dark_yellow = "#d79921"
dark_blue = "#458588"
dark_purple = "#b16286"
dark_aqua = "#689d6a"
dark_gray = "#a89984"
dark_orange = "#d65d0e"
### Completion
# Text color of the completion widget. May be a single color to use for
# all columns or a list of three colors, one for each column.
c.colors.completion.fg = [fg1, bright_aqua, bright_yellow]
# Background color of the completion widget for odd rows.
c.colors.completion.odd.bg = bg0
# Background color of the completion widget for even rows.
c.colors.completion.even.bg = c.colors.completion.odd.bg
# Foreground color of completion widget category headers.
c.colors.completion.category.fg = bright_blue
# Background color of the completion widget category headers.
c.colors.completion.category.bg = bg1
# Top border color of the completion widget category headers.
c.colors.completion.category.border.top = c.colors.completion.category.bg
# Bottom border color of the completion widget category headers.
c.colors.completion.category.border.bottom = c.colors.completion.category.bg
# Foreground color of the selected completion item.
c.colors.completion.item.selected.fg = fg0
# Background color of the selected completion item.
c.colors.completion.item.selected.bg = bg4
# Top border color of the selected completion item.
c.colors.completion.item.selected.border.top = bg2
# Bottom border color of the selected completion item.
c.colors.completion.item.selected.border.bottom = c.colors.completion.item.selected.border.top
# Foreground color of the matched text in the selected completion item.
c.colors.completion.item.selected.match.fg = bright_orange
# Foreground color of the matched text in the completion.
c.colors.completion.match.fg = c.colors.completion.item.selected.match.fg
# Color of the scrollbar handle in the completion view.
c.colors.completion.scrollbar.fg = c.colors.completion.item.selected.fg
# Color of the scrollbar in the completion view.
c.colors.completion.scrollbar.bg = c.colors.completion.category.bg
### Context menu
# Background color of disabled items in the context menu.
c.colors.contextmenu.disabled.bg = bg3
# Foreground color of disabled items in the context menu.
c.colors.contextmenu.disabled.fg = fg3
# Background color of the context menu. If set to null, the Qt default is used.
c.colors.contextmenu.menu.bg = bg0
# Foreground color of the context menu. If set to null, the Qt default is used.
c.colors.contextmenu.menu.fg = fg2
# Background color of the context menus selected item. If set to null, the Qt default is used.
c.colors.contextmenu.selected.bg = bg2
#Foreground color of the context menus selected item. If set to null, the Qt default is used.
c.colors.contextmenu.selected.fg = c.colors.contextmenu.menu.fg
### Downloads
# Background color for the download bar.
c.colors.downloads.bar.bg = bg0
# Color gradient start for download text.
c.colors.downloads.start.fg = bg0
# Color gradient start for download backgrounds.
c.colors.downloads.start.bg = bright_blue
# Color gradient end for download text.
c.colors.downloads.stop.fg = c.colors.downloads.start.fg
# Color gradient stop for download backgrounds.
c.colors.downloads.stop.bg = bright_aqua
# Foreground color for downloads with errors.
c.colors.downloads.error.fg = bright_red
### Hints
# Font color for hints.
c.colors.hints.fg = bg0
# Background color for hints.
c.colors.hints.bg = 'rgba(250, 191, 47, 200)' # bright_yellow
# Font color for the matched part of hints.
c.colors.hints.match.fg = bg4
### Keyhint widget
# Text color for the keyhint widget.
c.colors.keyhint.fg = fg4
# Highlight color for keys to complete the current keychain.
c.colors.keyhint.suffix.fg = fg0
# Background color of the keyhint widget.
c.colors.keyhint.bg = bg0
### Messages
# Foreground color of an error message.
c.colors.messages.error.fg = bg0
# Background color of an error message.
c.colors.messages.error.bg = bright_red
# Border color of an error message.
c.colors.messages.error.border = c.colors.messages.error.bg
# Foreground color of a warning message.
c.colors.messages.warning.fg = bg0
# Background color of a warning message.
c.colors.messages.warning.bg = bright_purple
# Border color of a warning message.
c.colors.messages.warning.border = c.colors.messages.warning.bg
# Foreground color of an info message.
c.colors.messages.info.fg = fg2
# Background color of an info message.
c.colors.messages.info.bg = bg0
# Border color of an info message.
c.colors.messages.info.border = c.colors.messages.info.bg
### Prompts
# Foreground color for prompts.
c.colors.prompts.fg = fg2
# Border used around UI elements in prompts.
c.colors.prompts.border = f'1px solid {bg1}'
# Background color for prompts.
c.colors.prompts.bg = bg3
# Background color for the selected item in filename prompts.
c.colors.prompts.selected.bg = bg2
### Statusbar
# Foreground color of the statusbar.
c.colors.statusbar.normal.fg = fg2
# Background color of the statusbar.
c.colors.statusbar.normal.bg = bg0
# Foreground color of the statusbar in insert mode.
c.colors.statusbar.insert.fg = bg0
# Background color of the statusbar in insert mode.
c.colors.statusbar.insert.bg = dark_aqua
# Foreground color of the statusbar in passthrough mode.
c.colors.statusbar.passthrough.fg = bg0
# Background color of the statusbar in passthrough mode.
c.colors.statusbar.passthrough.bg = dark_blue
# Foreground color of the statusbar in private browsing mode.
c.colors.statusbar.private.fg = bright_purple
# Background color of the statusbar in private browsing mode.
c.colors.statusbar.private.bg = bg0
# Foreground color of the statusbar in command mode.
c.colors.statusbar.command.fg = fg3
# Background color of the statusbar in command mode.
c.colors.statusbar.command.bg = bg1
# Foreground color of the statusbar in private browsing + command mode.
c.colors.statusbar.command.private.fg = c.colors.statusbar.private.fg
# Background color of the statusbar in private browsing + command mode.
c.colors.statusbar.command.private.bg = c.colors.statusbar.command.bg
# Foreground color of the statusbar in caret mode.
c.colors.statusbar.caret.fg = bg0
# Background color of the statusbar in caret mode.
c.colors.statusbar.caret.bg = dark_purple
# Foreground color of the statusbar in caret mode with a selection.
c.colors.statusbar.caret.selection.fg = c.colors.statusbar.caret.fg
# Background color of the statusbar in caret mode with a selection.
c.colors.statusbar.caret.selection.bg = bright_purple
# Background color of the progress bar.
c.colors.statusbar.progress.bg = bright_blue
# Default foreground color of the URL in the statusbar.
c.colors.statusbar.url.fg = fg4
# Foreground color of the URL in the statusbar on error.
c.colors.statusbar.url.error.fg = dark_red
# Foreground color of the URL in the statusbar for hovered links.
c.colors.statusbar.url.hover.fg = bright_orange
# Foreground color of the URL in the statusbar on successful load
# (http).
c.colors.statusbar.url.success.http.fg = bright_red
# Foreground color of the URL in the statusbar on successful load
# (https).
c.colors.statusbar.url.success.https.fg = fg0
# Foreground color of the URL in the statusbar when there's a warning.
c.colors.statusbar.url.warn.fg = bright_purple
### tabs
# Background color of the tab bar.
c.colors.tabs.bar.bg = bg0
# Color gradient start for the tab indicator.
c.colors.tabs.indicator.start = bright_blue
# Color gradient end for the tab indicator.
c.colors.tabs.indicator.stop = bright_aqua
# Color for the tab indicator on errors.
c.colors.tabs.indicator.error = bright_red
# Foreground color of unselected odd tabs.
c.colors.tabs.odd.fg = fg2
# Background color of unselected odd tabs.
c.colors.tabs.odd.bg = bg2
# Foreground color of unselected even tabs.
c.colors.tabs.even.fg = c.colors.tabs.odd.fg
# Background color of unselected even tabs.
c.colors.tabs.even.bg = bg3
# Foreground color of selected odd tabs.
c.colors.tabs.selected.odd.fg = fg2
# Background color of selected odd tabs.
c.colors.tabs.selected.odd.bg = bg0
# Foreground color of selected even tabs.
c.colors.tabs.selected.even.fg = c.colors.tabs.selected.odd.fg
# Background color of selected even tabs.
c.colors.tabs.selected.even.bg = bg0
# Background color of pinned unselected even tabs.
c.colors.tabs.pinned.even.bg = bright_green
# Foreground color of pinned unselected even tabs.
c.colors.tabs.pinned.even.fg = bg2
# Background color of pinned unselected odd tabs.
c.colors.tabs.pinned.odd.bg = bright_green
# Foreground color of pinned unselected odd tabs.
c.colors.tabs.pinned.odd.fg = c.colors.tabs.pinned.even.fg
# Background color of pinned selected even tabs.
c.colors.tabs.pinned.selected.even.bg = bg0
# Foreground color of pinned selected even tabs.
c.colors.tabs.pinned.selected.even.fg = c.colors.tabs.selected.odd.fg
# Background color of pinned selected odd tabs.
c.colors.tabs.pinned.selected.odd.bg = c.colors.tabs.pinned.selected.even.bg
# Foreground color of pinned selected odd tabs.
c.colors.tabs.pinned.selected.odd.fg = c.colors.tabs.selected.odd.fg
# Background color for webpages if unset (or empty to use the theme's
# color).
c.colors.webpage.bg = bg4

View file

@ -1,33 +0,0 @@
## ____ __
## / __ \_________ _/ /_____
## / / / / ___/ __ `/ //_/ _ \
## / /_/ / / / /_/ / ,< / __/ Clay Gomera (Drake)
## /_____/_/ \__,_/_/|_|\___/ My custom starship prompt config
##
add_newline = false
[line_break]
disabled = true
[character]
error_symbol = "[](bold red) "
success_symbol = "[](bold green)"
[directory]
truncation_length = 5
home_symbol = " "
format = "[$path](bold italic yellow) "
[hostname]
ssh_only = false
disabled = false
style = "italic #87A752"
[package]
disabled = true
[username]
show_always = true
style_user = "bold red"
format = "[$user]($style)[ in ](white)"

View file

@ -5,7 +5,7 @@
# - Dependencies: dmenu, fd, feh
## MAIN VARIABLES AND COMMANDS ##
walldir="Pictures/Wallpapers/" # wallpapers folder, change it to yours, make sure that it ends with a /
walldir="Pictures/Wallpapers"
cd "$walldir" || exit
## SELECT PICTURE FUNCTION ##

View file

@ -80,7 +80,7 @@ case "$cases" in
action;
check;;
$option5*)
qutebrowser http://networkcheck.kde.org;;
$BROWSER http://networkcheck.kde.org;;
$option6*)
exit 0
esac

View file

@ -4,7 +4,7 @@ static const unsigned int snap = 32; /* snap pixel */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const int horizpadbar = 2; /* horizontal padding for statusbar */
static const int vertpadbar = 8; /* vertical padding for statusbar */
static const int vertpadbar = 4; /* vertical padding for statusbar */
static const char *fonts[] = {"Symbols Nerd Font Mono:size=12", "mononoki Nerd Font:size=12"};
static const char dmenufont[] = {"mononoki Nerd Font:size=12"};
static const char col_gray1[] = "#1d2021";
@ -12,11 +12,18 @@ static const char col_gray2[] = "#32302f";
static const char col_gray3[] = "#d5c4a1";
static const char col_gray4[] = "#fbf1c7";
static const char col_cyan[] = "#cc241d";
static const unsigned int baralpha = 0xd0;
static const unsigned int borderalpha = OPAQUE;
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
};
static const unsigned int alphas[][3] = {
/* fg bg border*/
[SchemeNorm] = { OPAQUE, baralpha, borderalpha },
[SchemeSel] = { OPAQUE, baralpha, borderalpha },
};
/* scratchpads */
typedef struct {
@ -188,29 +195,29 @@ static const Key keys[] = {
// text editor
{ MODKEY, XK_e, spawn, SHCMD("st -n neovim -c neovim -e $HOME/.local/bin/lvim")},
// web browser
{ MODKEY, XK_w, spawn, SHCMD("qutebrowser")},
{ MODKEY, XK_w, spawn, SHCMD("brave")},
// chat
{ MODKEY, XK_s, spawn, SHCMD("flatpak run org.signal.Signal")},
/* keyboard layout */
// set keyboard layout to es
{ MODKEY|ControlMask, XK_e, spawn, SHCMD("setxkbmap -layout es")},
{ MODKEY|ControlMask, XK_e, spawn, SHCMD("setxkbmap -layout es && pkill -RTMIN+10 dwmblocks")},
// set keyboard layout to us
{ MODKEY|ControlMask, XK_u, spawn, SHCMD("setxkbmap -layout us")},
{ MODKEY|ControlMask, XK_u, spawn, SHCMD("setxkbmap -layout us && pkill -RTMIN+10 dwmblocks")},
/* XF86 Keys */
// increase volume
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pamixer -i 5")},
{ 0, XF86XK_AudioRaiseVolume, spawn, SHCMD("pamixer -i 5 && pkill -RTMIN+10 dwmblocks")},
// decrease volume
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pamixer -d 5")},
{ 0, XF86XK_AudioLowerVolume, spawn, SHCMD("pamixer -d 5 && pkill -RTMIN+10 dwmblocks")},
// mute volume
{ 0, XF86XK_AudioMute, spawn, SHCMD("pamixer -t")},
{ 0, XF86XK_AudioMute, spawn, SHCMD("pamixer -t && pkill -RTMIN+10 dwmblocks")},
// mute microphone
{ 0, XF86XK_AudioMicMute, spawn, SHCMD("pamixer --default-source -t")},
{ 0, XF86XK_AudioMicMute, spawn, SHCMD("pamixer --default-source -t && pkill -RTMIN+10 dwmblocks")},
// increase brightness
{ 0, XF86XK_MonBrightnessUp, spawn, SHCMD("xbacklight -inc 10")},
{ 0, XF86XK_MonBrightnessUp, spawn, SHCMD("xbacklight -inc 10 && pkill -RTMIN+10 dwmblocks")},
// decrease brightness
{ 0, XF86XK_MonBrightnessDown, spawn, SHCMD("xbacklight -dec 10")},
{ 0, XF86XK_MonBrightnessDown, spawn, SHCMD("xbacklight -dec 10 && pkill -RTMIN+10 dwmblocks")},
// display settings
{ 0, XF86XK_Display, spawn, SHCMD("arandr")},
// play/pause

View file

@ -23,7 +23,7 @@ FREETYPEINC = /usr/include/freetype2
# includes and libs
INCS = -I${X11INC} -I${FREETYPEINC}
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS}
LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lXrender
# flags
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}

View file

@ -61,7 +61,7 @@ utf8decode(const char *c, long *u, size_t clen)
}
Drw *
drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h)
drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap)
{
Drw *drw = ecalloc(1, sizeof(Drw));
@ -70,8 +70,11 @@ drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h
drw->root = root;
drw->w = w;
drw->h = h;
drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen));
drw->gc = XCreateGC(dpy, root, 0, NULL);
drw->visual = visual;
drw->depth = depth;
drw->cmap = cmap;
drw->drawable = XCreatePixmap(dpy, root, w, h, depth);
drw->gc = XCreateGC(dpy, drw->drawable, 0, NULL);
XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter);
return drw;
@ -87,7 +90,7 @@ drw_resize(Drw *drw, unsigned int w, unsigned int h)
drw->h = h;
if (drw->drawable)
XFreePixmap(drw->dpy, drw->drawable);
drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen));
drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, drw->depth);
}
void
@ -181,22 +184,21 @@ drw_fontset_free(Fnt *font)
}
void
drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha)
{
if (!drw || !dest || !clrname)
return;
if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
DefaultColormap(drw->dpy, drw->screen),
if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap,
clrname, dest))
die("error, cannot allocate color '%s'", clrname);
dest->pixel |= 0xff << 24;
dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24);
}
/* Wrapper to create color schemes. The caller has to call free(3) on the
* returned color scheme when done using it. */
Clr *
drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount)
{
size_t i;
Clr *ret;
@ -206,7 +208,7 @@ drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
return NULL;
for (i = 0; i < clrcount; i++)
drw_clr_create(drw, &ret[i], clrnames[i]);
drw_clr_create(drw, &ret[i], clrnames[i], alphas[i]);
return ret;
}
@ -264,9 +266,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
} else {
XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
d = XftDrawCreate(drw->dpy, drw->drawable,
DefaultVisual(drw->dpy, drw->screen),
DefaultColormap(drw->dpy, drw->screen));
d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap);
x += lpad;
w -= lpad;
}

View file

@ -20,6 +20,9 @@ typedef struct {
Display *dpy;
int screen;
Window root;
Visual *visual;
unsigned int depth;
Colormap cmap;
Drawable drawable;
GC gc;
Clr *scheme;
@ -27,7 +30,7 @@ typedef struct {
} Drw;
/* Drawable abstraction */
Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h);
Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap);
void drw_resize(Drw *drw, unsigned int w, unsigned int h);
void drw_free(Drw *drw);
@ -39,8 +42,8 @@ unsigned int drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int
void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h);
/* Colorscheme abstraction */
void drw_clr_create(Drw *drw, Clr *dest, const char *clrname);
Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount);
void drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha);
Clr *drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount);
/* Cursor abstraction */
Cur *drw_cur_create(Drw *drw, int shape);

View file

@ -60,6 +60,7 @@
#define SPTAG(i) ((1 << LENGTH(tags)) << (i))
#define SPTAGMASK (((1 << LENGTH(scratchpads))-1) << LENGTH(tags))
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
#define OPAQUE 0xffU
/* enums */
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
@ -245,6 +246,7 @@ static Monitor *wintomon(Window w);
static int xerror(Display *dpy, XErrorEvent *ee);
static int xerrordummy(Display *dpy, XErrorEvent *ee);
static int xerrorstart(Display *dpy, XErrorEvent *ee);
static void xinitvisual();
static void zoom(const Arg *arg);
/* variables */
@ -282,6 +284,11 @@ static Drw *drw;
static Monitor *mons, *selmon;
static Window root, wmcheckwin;
static int useargb = 0;
static Visual *visual;
static int depth;
static Colormap cmap;
/* configuration, allows nested code to access above variables */
#include "config.h"
@ -1607,7 +1614,8 @@ setup(void)
sw = DisplayWidth(dpy, screen);
sh = DisplayHeight(dpy, screen);
root = RootWindow(dpy, screen);
drw = drw_create(dpy, screen, root, sw, sh);
xinitvisual();
drw = drw_create(dpy, screen, root, sw, sh, visual, depth, cmap);
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
die("no fonts could be loaded.");
lrpad = drw->fonts->h + horizpadbar;
@ -1635,7 +1643,7 @@ setup(void)
/* init appearance */
scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
for (i = 0; i < LENGTH(colors); i++)
scheme[i] = drw_scm_create(drw, colors[i], 3);
scheme[i] = drw_scm_create(drw, colors[i], alphas[i], 3);
/* init bars */
updatebars();
updatestatus();
@ -1936,16 +1944,18 @@ updatebars(void)
Monitor *m;
XSetWindowAttributes wa = {
.override_redirect = True,
.background_pixmap = ParentRelative,
.background_pixel = 0,
.border_pixel = 0,
.colormap = cmap,
.event_mask = ButtonPressMask|ExposureMask
};
XClassHint ch = {"dwm", "dwm"};
for (m = mons; m; m = m->next) {
if (m->barwin)
continue;
m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
CopyFromParent, DefaultVisual(dpy, screen),
CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, depth,
InputOutput, visual,
CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa);
XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
XMapRaised(dpy, m->barwin);
XSetClassHint(dpy, m->barwin, &ch);
@ -2291,6 +2301,43 @@ xerrorstart(Display *dpy, XErrorEvent *ee)
return -1;
}
void
xinitvisual()
{
XVisualInfo *infos;
XRenderPictFormat *fmt;
int nitems;
int i;
XVisualInfo tpl = {
.screen = screen,
.depth = 32,
.class = TrueColor
};
long masks = VisualScreenMask | VisualDepthMask | VisualClassMask;
infos = XGetVisualInfo(dpy, masks, &tpl, &nitems);
visual = NULL;
for(i = 0; i < nitems; i ++) {
fmt = XRenderFindVisualFormat(dpy, infos[i].visual);
if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
visual = infos[i].visual;
depth = infos[i].depth;
cmap = XCreateColormap(dpy, root, visual, AllocNone);
useargb = 1;
break;
}
}
XFree(infos);
if (! visual) {
visual = DefaultVisual(dpy, screen);
depth = DefaultDepth(dpy, screen);
cmap = DefaultColormap(dpy, screen);
}
}
void
zoom(const Arg *arg)
{

View file

@ -0,0 +1,288 @@
From ad5887df95fda706291c81ee143d0786a1717b12 Mon Sep 17 00:00:00 2001
From: getimiskon <getimiskon@disroot.org>
Date: Sat, 1 Apr 2023 16:22:01 +0300
Subject: [PATCH] Allow dwm to have translucent bars, while keeping all the
text on it opaque, just like the alpha-patch for st. Updated for 348f655.
---
config.def.h | 7 +++++++
config.mk | 2 +-
drw.c | 26 ++++++++++++-----------
drw.h | 9 +++++---
dwm.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++------
5 files changed, 81 insertions(+), 22 deletions(-)
diff --git a/config.def.h b/config.def.h
index 9efa774..8b3789a 100644
--- a/config.def.h
+++ b/config.def.h
@@ -12,11 +12,18 @@ static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#005577";
+static const unsigned int baralpha = 0xd0;
+static const unsigned int borderalpha = OPAQUE;
static const char *colors[][3] = {
/* fg bg border */
[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
[SchemeSel] = { col_gray4, col_cyan, col_cyan },
};
+static const unsigned int alphas[][3] = {
+ /* fg bg border*/
+ [SchemeNorm] = { OPAQUE, baralpha, borderalpha },
+ [SchemeSel] = { OPAQUE, baralpha, borderalpha },
+};
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
diff --git a/config.mk b/config.mk
index ba64d3d..d609c42 100644
--- a/config.mk
+++ b/config.mk
@@ -23,7 +23,7 @@ FREETYPEINC = /usr/include/freetype2
# includes and libs
INCS = -I${X11INC} -I${FREETYPEINC}
-LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS}
+LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lXrender
# flags
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
diff --git a/drw.c b/drw.c
index a58a2b4..d18e8d8 100644
--- a/drw.c
+++ b/drw.c
@@ -61,7 +61,7 @@ utf8decode(const char *c, long *u, size_t clen)
}
Drw *
-drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h)
+drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap)
{
Drw *drw = ecalloc(1, sizeof(Drw));
@@ -70,8 +70,11 @@ drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h
drw->root = root;
drw->w = w;
drw->h = h;
- drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen));
- drw->gc = XCreateGC(dpy, root, 0, NULL);
+ drw->visual = visual;
+ drw->depth = depth;
+ drw->cmap = cmap;
+ drw->drawable = XCreatePixmap(dpy, root, w, h, depth);
+ drw->gc = XCreateGC(dpy, drw->drawable, 0, NULL);
XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter);
return drw;
@@ -87,7 +90,7 @@ drw_resize(Drw *drw, unsigned int w, unsigned int h)
drw->h = h;
if (drw->drawable)
XFreePixmap(drw->dpy, drw->drawable);
- drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen));
+ drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, drw->depth);
}
void
@@ -181,21 +184,22 @@ drw_fontset_free(Fnt *font)
}
void
-drw_clr_create(Drw *drw, Clr *dest, const char *clrname)
+drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha)
{
if (!drw || !dest || !clrname)
return;
- if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen),
- DefaultColormap(drw->dpy, drw->screen),
+ if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap,
clrname, dest))
die("error, cannot allocate color '%s'", clrname);
+
+ dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24);
}
/* Wrapper to create color schemes. The caller has to call free(3) on the
* returned color scheme when done using it. */
Clr *
-drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
+drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount)
{
size_t i;
Clr *ret;
@@ -205,7 +209,7 @@ drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount)
return NULL;
for (i = 0; i < clrcount; i++)
- drw_clr_create(drw, &ret[i], clrnames[i]);
+ drw_clr_create(drw, &ret[i], clrnames[i], alphas[i]);
return ret;
}
@@ -263,9 +267,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
} else {
XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel);
XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h);
- d = XftDrawCreate(drw->dpy, drw->drawable,
- DefaultVisual(drw->dpy, drw->screen),
- DefaultColormap(drw->dpy, drw->screen));
+ d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap);
x += lpad;
w -= lpad;
}
diff --git a/drw.h b/drw.h
index 6471431..2143533 100644
--- a/drw.h
+++ b/drw.h
@@ -20,6 +20,9 @@ typedef struct {
Display *dpy;
int screen;
Window root;
+ Visual *visual;
+ unsigned int depth;
+ Colormap cmap;
Drawable drawable;
GC gc;
Clr *scheme;
@@ -27,7 +30,7 @@ typedef struct {
} Drw;
/* Drawable abstraction */
-Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h);
+Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap);
void drw_resize(Drw *drw, unsigned int w, unsigned int h);
void drw_free(Drw *drw);
@@ -39,8 +42,8 @@ unsigned int drw_fontset_getwidth_clamp(Drw *drw, const char *text, unsigned int
void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h);
/* Colorscheme abstraction */
-void drw_clr_create(Drw *drw, Clr *dest, const char *clrname);
-Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount);
+void drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha);
+Clr *drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount);
/* Cursor abstraction */
Cur *drw_cur_create(Drw *drw, int shape);
diff --git a/dwm.c b/dwm.c
index c2bd871..3b34de8 100644
--- a/dwm.c
+++ b/dwm.c
@@ -56,6 +56,7 @@
#define HEIGHT(X) ((X)->h + 2 * (X)->bw)
#define TAGMASK ((1 << LENGTH(tags)) - 1)
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
+#define OPAQUE 0xffU
/* enums */
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
@@ -232,6 +233,7 @@ static Monitor *wintomon(Window w);
static int xerror(Display *dpy, XErrorEvent *ee);
static int xerrordummy(Display *dpy, XErrorEvent *ee);
static int xerrorstart(Display *dpy, XErrorEvent *ee);
+static void xinitvisual();
static void zoom(const Arg *arg);
/* variables */
@@ -268,6 +270,11 @@ static Drw *drw;
static Monitor *mons, *selmon;
static Window root, wmcheckwin;
+static int useargb = 0;
+static Visual *visual;
+static int depth;
+static Colormap cmap;
+
/* configuration, allows nested code to access above variables */
#include "config.h"
@@ -1558,7 +1565,8 @@ setup(void)
sw = DisplayWidth(dpy, screen);
sh = DisplayHeight(dpy, screen);
root = RootWindow(dpy, screen);
- drw = drw_create(dpy, screen, root, sw, sh);
+ xinitvisual();
+ drw = drw_create(dpy, screen, root, sw, sh, visual, depth, cmap);
if (!drw_fontset_create(drw, fonts, LENGTH(fonts)))
die("no fonts could be loaded.");
lrpad = drw->fonts->h;
@@ -1586,7 +1594,7 @@ setup(void)
/* init appearance */
scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
for (i = 0; i < LENGTH(colors); i++)
- scheme[i] = drw_scm_create(drw, colors[i], 3);
+ scheme[i] = drw_scm_create(drw, colors[i], alphas[i], 3);
/* init bars */
updatebars();
updatestatus();
@@ -1813,16 +1821,18 @@ updatebars(void)
Monitor *m;
XSetWindowAttributes wa = {
.override_redirect = True,
- .background_pixmap = ParentRelative,
+ .background_pixel = 0,
+ .border_pixel = 0,
+ .colormap = cmap,
.event_mask = ButtonPressMask|ExposureMask
};
XClassHint ch = {"dwm", "dwm"};
for (m = mons; m; m = m->next) {
if (m->barwin)
continue;
- m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
- CopyFromParent, DefaultVisual(dpy, screen),
- CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
+ m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, depth,
+ InputOutput, visual,
+ CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa);
XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
XMapRaised(dpy, m->barwin);
XSetClassHint(dpy, m->barwin, &ch);
@@ -2120,6 +2130,43 @@ xerrorstart(Display *dpy, XErrorEvent *ee)
return -1;
}
+void
+xinitvisual()
+{
+ XVisualInfo *infos;
+ XRenderPictFormat *fmt;
+ int nitems;
+ int i;
+
+ XVisualInfo tpl = {
+ .screen = screen,
+ .depth = 32,
+ .class = TrueColor
+ };
+ long masks = VisualScreenMask | VisualDepthMask | VisualClassMask;
+
+ infos = XGetVisualInfo(dpy, masks, &tpl, &nitems);
+ visual = NULL;
+ for(i = 0; i < nitems; i ++) {
+ fmt = XRenderFindVisualFormat(dpy, infos[i].visual);
+ if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) {
+ visual = infos[i].visual;
+ depth = infos[i].depth;
+ cmap = XCreateColormap(dpy, root, visual, AllocNone);
+ useargb = 1;
+ break;
+ }
+ }
+
+ XFree(infos);
+
+ if (! visual) {
+ visual = DefaultVisual(dpy, screen);
+ depth = DefaultDepth(dpy, screen);
+ cmap = DefaultColormap(dpy, screen);
+ }
+}
+
void
zoom(const Arg *arg)
{
--
2.40.0

View file

@ -1,10 +1,8 @@
PREFIX ?= /usr/local
CC ?= cc
output: dwmblocks.c blocks.def.h blocks.h
output: dwmblocks.c
${CC} `pkg-config --cflags x11 --libs x11` dwmblocks.c -o dwmblocks
blocks.h:
cp -v blocks.def.h $@
clean:
rm -fv *.o *.gch dwmblocks
install: output

View file

@ -1,17 +1,17 @@
//Modify this file to change what commands output to your statusbar, and recompile using the make command.
static const Block blocks[] = {
/*Command*/ /*Update Interval*/ /*Update Signal*/
{"", "$HOME/.config/suckless/dwmblocks/scripts/block_layout", 5, 5},
{"", "$HOME/.config/suckless/dwmblocks/scripts/block_layout", 0, 10},
{"", "$HOME/.config/suckless/dwmblocks/scripts/block_battery", 10, 10},
{"", "$HOME/.config/suckless/dwmblocks/scripts/block_battery", 10, 1},
{"", "$HOME/.config/suckless/dwmblocks/scripts/block_brightness", 5, 5},
{"", "$HOME/.config/suckless/dwmblocks/scripts/block_brightness", 0, 10},
{"", "$HOME/.config/suckless/dwmblocks/scripts/block_volume", 1, 0},
{"", "$HOME/.config/suckless/dwmblocks/scripts/block_volume", 0, 10},
{"", "$HOME/.config/suckless/dwmblocks/scripts/block_clock", 1, 0},
{"", "$HOME/.config/suckless/dwmblocks/scripts/block_clock", 60, 1},
{"", "$HOME/.config/suckless/dwmblocks/scripts/block_wifi", 10, 10},
{"", "$HOME/.config/suckless/dwmblocks/scripts/block_wifi", 5, 4},
};
//sets delimeter between status commands. NULL character ('\0') means no delimeter.

View file

@ -8,21 +8,93 @@ elif [ "${currntpwr}" = "balanced" ]; then
elif [ "${currntpwr}" = "power-saver" ]; then
pwr=" | 󰾆 PowerSaver "
fi
for battery in /sys/class/power_supply/BAT?*; do
# If non-first battery, print a space separator.
[ -n "${capacity+x}" ] && printf " "
# Sets up the status and capacity
case "$(cat "$battery/status" 2>&1)" in
"Full") status=" 󱊣" ;;
"Discharging") status=" 󱊢" ;;
"Charging") status=" 󱊥" ;;
"Not charging") status=" 󱊥" ;;
"Unknown") status=" 󰂎" ;;
"Full")
status=" 󰁹"
;;
"Discharging")
# Calculates the percentage of remaining charge
percentage="$(cat "$battery/capacity" 2>&1)"
# Updates the status icon based on the battery percentage
if [ "$percentage" -lt 20 ]
then
status=" 󰁻"
elif [ "$percentage" -lt 30 ]
then
status=" 󰁼"
elif [ "$percentage" -lt 40 ]
then
status=" 󰁽"
elif [ "$percentage" -lt 50 ]
then
status=" 󰁾"
elif [ "$percentage" -lt 60 ]
then
status=" 󰁿"
elif [ "$percentage" -lt 70 ]
then
status=" 󰂀"
elif [ "$percentage" -lt 80 ]
then
status=" 󰂁"
elif [ "$percentage" -lt 90 ]
then
status=" 󰂂"
fi
;;
"Charging")
# Calculates the percentage of remaining charge
percentage="$(cat "$battery/capacity" 2>&1)"
# Updates the status icon based on the battery percentage while charging
if [ "$percentage" -lt 10 ]
then
status=" 󰢜"
elif [ "$percentage" -lt 20 ]
then
status=" 󰂆"
elif [ "$percentage" -lt 30 ]
then
status=" 󰂇"
elif [ "$percentage" -lt 40 ]
then
status=" 󰂈"
elif [ "$percentage" -lt 50 ]
then
status=" 󰢝"
elif [ "$percentage" -lt 60 ]
then
status=" 󰂉"
elif [ "$percentage" -lt 70 ]
then
status=" 󰢞"
elif [ "$percentage" -lt 80 ]
then
status=" 󰂊"
elif [ "$percentage" -lt 90 ]
then
status=" 󰂋"
else
status=" 󰂅"
fi
;;
"Not charging")
status=" 󰂃"
;;
"Unknown")
status=" 󰂃"
;;
*) exit 1 ;;
esac
capacity="$(cat "$battery/capacity" 2>&1)"
# Will make a warn variable if discharging and low
[ "$status" = "󰂎" ] && [ "$capacity" -le 100 ] && warn=""
[ "$status" = " 󰁺" ] && [ "$percentage" -le 10 ] && warn="󱈸"
# Prints the info
printf "%s%s%d%%%s" "$status" "$warn " "$capacity" "$pwr"; unset warn
printf "%s%s%d%%%s" "$status" "$warn " "$percentage" "$pwr"; unset warn
done && printf "\\n"

View file

@ -1,10 +1,24 @@
#!/bin/bash
brt=$(xbacklight -get)
if [ "$brt" = "100.000000" ]; then
icon="󰃠"
elif [ "$brt" \> "50%.*" ]; then
icon="󰃟"
elif [ "$brt" \< "49%.*" ]; then
icon="󰃞"
if [ "${brt%.*}" -eq 100 ]; then
icon="󰛨"
elif [ "${brt%.*}" -ge 90 ]; then
icon="󱩖"
elif [ "${brt%.*}" -ge 80 ]; then
icon="󱩕"
elif [ "${brt%.*}" -ge 70 ]; then
icon="󱩔"
elif [ "${brt%.*}" -ge 60 ]; then
icon="󱩓"
elif [ "${brt%.*}" -ge 50 ]; then
icon="󱩒"
elif [ "${brt%.*}" -ge 40 ]; then
icon="󱩑"
elif [ "${brt%.*}" -ge 30 ]; then
icon="󱩐"
elif [ "${brt%.*}" -ge 20 ]; then
icon="󱩏"
else
icon="󱩎"
fi
echo " $icon ${brt%.*}% "

View file

@ -1,4 +1,20 @@
#!/bin/bash
date="$(date +%d/%m/%y)"
clock="$(date +%R)"
echo " 󰸗 $date | 󰥔 $clock "
hour="$(date +%I)"
clock_icon=""
case $hour in
"01") clock_icon="󱐿";;
"02") clock_icon="󱑀";;
"03") clock_icon="󱑁";;
"04") clock_icon="󱑂";;
"05") clock_icon="󱑃";;
"06") clock_icon="󱑄";;
"07") clock_icon="󱑅";;
"08") clock_icon="󱑆";;
"09") clock_icon="󱑇";;
"10") clock_icon="󱑈";;
"11") clock_icon="󱑉";;
"12") clock_icon="󱑊";;
esac
clock="$(date +%I:%M%p | sed 's/^0//')"
echo " $clock_icon $clock | 󰸗 $date "

View file

@ -1,11 +1,34 @@
#!/bin/bash
get_wifi_strength() {
# Retrieves the wifi signal strength in dBm
strength=$(nmcli -t -f active,ssid,signal dev wifi | grep yes | cut -d ":" -f3)
# Converts dBm to percentage (0% to 100%)
if [ "$strength" -le 30 ]; then
echo "1"
elif [ "$strength" -le 60 ]; then
echo "2"
elif [ "$strength" -le 90 ]; then
echo "3"
else
echo "4"
fi
}
constate=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f3 | head -1)
currentwfi=$(nmcli dev | grep wifi | sed 's/ \{2,\}/|/g' | cut -d '|' -f4 | head -1)
if [ "$constate" = "disconnected" ]; then
echo " 󰤮 "
elif [ "$constate" = "connected" ]; then
echo " 󰤥 $currentwfi"
strength=$(get_wifi_strength)
case "$strength" in
"1") icon=" 󰤟 " ;;
"2") icon=" 󰤢 " ;;
"3") icon=" 󰤥 " ;;
"4") icon=" 󰤨 " ;;
esac
echo "$icon$currentwfi"
else
echo " 󰤮 "
fi

View file

@ -98,7 +98,7 @@ char *termname = "st-256color";
unsigned int tabspaces = 4;
/* bg opacity */
float alpha = 0.98;
float alpha = 0.9;
/* Terminal colors (16 first used in escape sequence) */
static const char *colorname[] = {

View file

@ -30,6 +30,7 @@ if [ -f "$usermodmap" ]; then
fi
### ENVIRONMENT VARIABLES
export BROWSER="brave"
export MOZ_USE_XINPUT2=1
export XDG_DATA_HOME="${XDG_DATA_HOME:="$HOME/.local/share"}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:="$HOME/.cache"}"