diff --git a/alacritty/alacritty.yml b/alacritty/alacritty.yml index 25523a5..df50916 100644 --- a/alacritty/alacritty.yml +++ b/alacritty/alacritty.yml @@ -77,17 +77,6 @@ scrolling: # scroll back is enabled (history > 0). multiplier: 3 - # Scroll to the bottom when new text is written to the terminal. - auto_scroll: false - -# Spaces per Tab (changes require restart) -# -# This setting defines the width of a tab in cells. -# -# Some applications, like Emacs, rely on knowing about the width of a tab. -# To prevent unexpected behavior in these applications, it's also required to -# change the `it` value in terminfo when altering this setting. -tabspaces: 4 # Font configuration (changes require restart) font: diff --git a/bin/create-wal-theme b/bin/create-wal-theme index 441fc87..9b09c20 100644 --- a/bin/create-wal-theme +++ b/bin/create-wal-theme @@ -28,18 +28,18 @@ help_section="Create a theme with wal and copy the theme JSON in the appropriate Usage: $0 IMAGE_PATH [-o/--output OUTPUT_DIR] [--light-mode] Options: -* -o, --output OUTPUT_DIR - The location where the JSON file will be copied. - The given argument should be a directory that already exists. - The default value is given from the 'OUTPUT' variable. +* -o, --output - The location of the wal config folder. + The default value is '$HOME/.config/wal'. * --light-mode - Create a light mode theme. Appends the resulting file name with '$LIGHT_MODE_SUFFIX'. -* -b, --background BG_COLOR - Creates the theme with the following background color. +* -b, --background - Creates the theme with the following background color. This is passed to the 'wal' command. +* -e, --execute - Append the resulting wal command with the given string. " # Setting the variables for the program. # Feel free to change `OUTPUT_DIR`. -OUTPUT_DIR="~/.local/share/wal" +OUTPUT_DIR="$HOME/.config/wal" LIGHT_MODE=0 IMAGE_PATH="$1" @@ -60,6 +60,10 @@ do BG_COLOR="$2" shift shift;; + -e|--execute) + EXECUTE="$2" + shift + shift;; *) shift;; esac @@ -67,7 +71,7 @@ done image_basename=$(extract_path_without_ext "$IMAGE_PATH") wal_command_string="wal -i $IMAGE_PATH" -output_file=$([ $LIGHT_MODE -eq 1 ] && echo "$OUTPUT_DIR/$image_basename$LIGHT_MODE_SUFFIX.json" || echo "$OUTPUT_DIR/$image_basename.json") +output_file=$([ $LIGHT_MODE -eq 1 ] && echo "$OUTPUT_DIR/colorschemes/light/$image_basename" || echo "$OUTPUT_DIR/colorschemes/dark/$image_basename.json") if [[ $LIGHT_MODE -eq 1 ]]; then wal_command_string+=" -l" @@ -77,4 +81,8 @@ if [[ -n "$BG_COLOR" ]]; then wal_command_string+=" -b $BG_COLOR" fi +if [[ -n "$EXECUTE" ]]; then + wal_command_string+="$EXECUTE" +fi + command -p $wal_command_string && cp "$CACHE_DIR/colors.json" "$output_file" diff --git a/nvim/init.vim b/nvim/init.vim index cf1494a..5bc515f 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -1,15 +1,25 @@ -" Plugin list (using vim-plug). -" Activate it with ':PlugInstall' for the first time. +""""""""""" +" Plugins " +""""""""""" + +" This configuration uses vim-plug (https://github.com/junegunn/vim-plug) as +" the plugin manager. +" Activate it with ':PlugInstall' for the first time (and when adding new plugins). +" And run ':PlugUpgrade' for upgrading the plugins. call plug#begin('~/.config/nvim/plugged') +" A snippets engine. +" One of the must-haves for me. Plug 'sirver/ultisnips' -" Setting my private snippets in a consistent home directory -let g:UltiSnipsSnippetDirectories = [$HOME . "/.config/nvim/own-snippets", "own-snippets"] +" Setting my private snippets in a consistent home directory and a relative snippets directory for project-specific snippets. +let g:UltiSnipsSnippetDirectories = [$HOME . "/.config/nvim/own-snippets", ".snippets"] let g:UltiSnipsExpandTrigger="" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" let g:UltiSnipsEditSplit="context" +" A completion engine. +" I chose this engine since it is linked from UltiSnips. if has('nvim') Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } else @@ -19,13 +29,18 @@ else endif let g:deoplete#enable_at_startup = 1 +" A built-in file explorer inside of Vim. Plug 'scrooloose/nerdtree' +" Contains various snippets for UltiSnips. Plug 'honza/vim-snippets' +" Plugin for auto-saving for each change in the buffer (file). Plug '907th/vim-auto-save' let g:auto_save = 1 +" One of the most popular plugins. +" Allows to create more substantial status bars. Plug 'vim-airline/vim-airline' let g:airline_powerline_fonts = 1 @@ -33,6 +48,9 @@ if !exists('g:airline_symbols') let g:airline_symbols = {} endif +" A full LaTeX toolchain plugin for Vim. +" Also a must-have for me since writing LaTeX can be a PITA. +" Most of the snippets and workflow is inspired from Gilles Castel's posts (at https://castel.dev/). Plug 'lervag/vimtex' let g:tex_flavor='latex' let g:vimtex_view_method='zathura' @@ -48,6 +66,7 @@ let g:vimtex_compiler_latexmk = { \ ] \} +" I use LuaLaTeX for my documents so let me have it as the default, please? let g:vimtex_compiler_latexmk_engines = { \ '_' : '-lualatex', \ 'pdflatex' : '-pdf', @@ -59,11 +78,20 @@ let g:vimtex_compiler_latexmk_engines = { \ 'context (xetex)' : '-pdf -pdflatex=''texexec --xtx''', \} +" Enable visuals for addition/deletion of lines in the gutter (side) similar to Visual Studio Code. Plug 'airblade/vim-gitgutter' +" Plugin for distraction-free writing. +Plug 'junegunn/goyo.vim' call plug#end() + + +""""""""""""""""""""""""" +" Editor configurations " +""""""""""""""""""""""""" + " Quick escape to default mode. inoremap jk @@ -87,6 +115,7 @@ let template_list = [ \ ["", ".synctex"], \] +" Additional LaTeX files cleanup. function VimtexAdditionalCleanup(template_list) call vimtex#compiler#clean(1) let file_name = expand("%:t:r") @@ -118,7 +147,11 @@ autocmd vimenter * NERDTree " Set list and other listing characters (:h listchars). set list listchars=tab:→\ ,trail:· -" Show leading spaces. +" Instant Goyo toggle +map f :Goyo \| set linebreak + +" Show leading spaces. +" I don't know what is happening here but I'll know it... someday. " SOURCE: https://www.reddit.com/r/vim/comments/5fxsfy/show_leading_spaces/ hi Conceal guibg=NONE ctermbg=NONE ctermfg=DarkGrey autocmd BufWinEnter * setl conceallevel=1 @@ -128,7 +161,7 @@ autocmd BufReadPre * syn match LeadingSpace /\(^ *\)\@<= / containedin=ALL conce " Enabling spell checker (for your local language, anyway). setlocal spell -set spelllang=en_gb +set spelllang=en_gb,en_us inoremap u[s1z=`]au " Changing style of words. diff --git a/nvim/own-snippets/all.snippets b/nvim/own-snippets/all.snippets index 2f6f43a..f463752 100644 --- a/nvim/own-snippets/all.snippets +++ b/nvim/own-snippets/all.snippets @@ -8,10 +8,11 @@ def relative_date(days): return calculated_date endglobal -snippet "reldate (\d+)" "Prints out the relative date in ISO format." ri +snippet "reldate (\d+)( ".+")?" "Prints out the relative date in ISO format." ri `!p reldate = relative_date(match.group(1)) -snip.rv = reldate.strftime("%F") +date_format = match.group(2).strip(" \"") if match.group(2) is not None else "%F" +snip.rv = reldate.strftime(date_format) ` endsnippet @@ -68,3 +69,19 @@ snippet #! "Quick snippet for a shebang." bi #!${1:/usr/bin/env} ${2:sh} endsnippet +# This is only useful for decorative comment boxes and all of the jazz. +snippet "boxen '(.*)'" "Create a box of stuff" ir +`!p snip.rv = (match.group(1) * (len(t[1]) + 4)).strip()[0:(len(t[1]) + 4)]` +`!p snip.rv = match.group(1)[0]` $1 `!p snip.rv = match.group(1)[0]` +`!p snip.rv = (match.group(1) * (len(t[1]) + 4)).strip()[0:(len(t[1]) + 4)]` +$0 +endsnippet + +# Also stolen from Gilles Castel's post at https://castel.dev/post/lecture-notes-1/. +snippet box "More box (that looks more like a box)." +`!p snip.rv = '┌' + '─' * (len(t[1]) + 2) + '┐'` +│ $1 │ +`!p snip.rv = '└' + '─' * (len(t[1]) + 2) + '┘'` +$0 +endsnippet + diff --git a/nvim/own-snippets/asciidoc.snippets b/nvim/own-snippets/asciidoc.snippets index e5f28aa..2864174 100644 --- a/nvim/own-snippets/asciidoc.snippets +++ b/nvim/own-snippets/asciidoc.snippets @@ -14,7 +14,7 @@ def smart_space(next_str, auto_str=" ", loose=False): endglobal # Text formatting -snippet "h(\d)" "Quick header snippet" bir +snippet "h(([1-6]))" "Quick header snippet" bir `!p header_level = int(match.group(1)) legit_header_level = True if header_level >= 1 and header_level <= 6 else False diff --git a/nvim/own-snippets/sh.snippets b/nvim/own-snippets/sh.snippets index 3d1d7c2..78d5050 100644 --- a/nvim/own-snippets/sh.snippets +++ b/nvim/own-snippets/sh.snippets @@ -17,6 +17,12 @@ do done endsnippet +snippet if "If conditional" iw +if ${1:}; then +${2:} +fi +endsnippet + snippet while "While loop" iw while ${1:}; do @@ -24,3 +30,17 @@ do done endsnippet +snippet getopts "An argument parser with getopts" iw +while getopts ${1:} ${2:arg} +do + case ${2:"h"} in + h) + echo $_help + exit 0 + *) + echo $_help + exit 0 + esca +done +endsnippet + diff --git a/picom/picom.conf b/picom/picom.conf index fa8bd6d..7e35146 100644 --- a/picom/picom.conf +++ b/picom/picom.conf @@ -1,234 +1,226 @@ -# Thank you code_nomad: http://9m.no/ꪯ鵞 -# and Arch Wiki contributors: https://wiki.archlinux.org/index.php/Compton - -################################# -# -# Backend -# -################################# - -# Backend to use: "xrender" or "glx". -# GLX backend is typically much faster but depends on a sane driver. -backend = "glx"; - -################################# -# -# GLX backend -# -################################# - -glx-no-stencil = true; - -# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all. -# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified, -# but a 20% increase when only 1/4 is. -# My tests on nouveau show terrible slowdown. -glx-copy-from-front = false; - -# GLX backend: Use MESA_copy_sub_buffer to do partial screen update. -# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated. -# May break VSync and is not available on some drivers. -# Overrides --glx-copy-from-front. -# glx-use-copysubbuffermesa = true; - -# GLX backend: Avoid rebinding pixmap on window damage. -# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe). -# Recommended if it works. -# glx-no-rebind-pixmap = true; - -# GLX backend: GLX buffer swap method we assume. -# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1). -# undefined is the slowest and the safest, and the default value. -# copy is fastest, but may fail on some drivers, -# 2-6 are gradually slower but safer (6 is still faster than 0). -# Usually, double buffer means 2, triple buffer means 3. -# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers. -# Useless with --glx-use-copysubbuffermesa. -# Partially breaks --resize-damage. -# Defaults to undefined. -#glx-swap-method = "undefined"; - -################################# -# -# Shadows -# -################################# - -# Enabled client-side shadows on windows. -shadow = false; -# The blur radius for shadows. (default 12) -shadow-radius = 5; -# The left offset for shadows. (default -15) -shadow-offset-x = -5; -# The top offset for shadows. (default -15) -shadow-offset-y = -5; -# The translucency for shadows. (default .75) -shadow-opacity = 0.5; - -# Set if you want different colour shadows -# shadow-red = 0.0; -# shadow-green = 0.0; -# shadow-blue = 0.0; - -# The shadow exclude options are helpful if you have shadows enabled. Due to the way picom draws its shadows, certain applications will have visual glitches -# (most applications are fine, only apps that do weird things with xshapes or argb are affected). -# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher. -shadow-exclude = [ - "! name~=''", - "name = 'Notification'", - "name = 'Plank'", - "name = 'Docky'", - "name = 'Kupfer'", - "name = 'xfce4-notifyd'", - "name *= 'VLC'", - "name *= 'compton'", - "name *= 'picom'", - "name *= 'Chromium'", - "name *= 'Chrome'", - "class_g = 'Firefox' && argb", - "class_g = 'Conky'", - "class_g = 'Kupfer'", - "class_g = 'Synapse'", - "class_g ?= 'Notify-osd'", - "class_g ?= 'Cairo-dock'", - "class_g ?= 'Xfce4-notifyd'", - "class_g ?= 'Xfce4-power-manager'", - "_GTK_FRAME_EXTENTS@:c", - "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" -]; -# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners) -shadow-ignore-shaped = false; - -################################# -# -# Opacity -# -################################# - -inactive-opacity = 0.75; -active-opacity = 1; -frame-opacity = 1; -inactive-opacity-override = true; -opacity-rule = [ - "90:class_g = 'alacritty' && focused", - "60:class_g = 'alacritty' && !focused", - "100:class_g = 'slop'" -]; - - -# Dim inactive windows. (0.0 - 1.0) -inactive-dim = 0.5; -# Do not let dimness adjust based on window opacity. -inactive-dim-fixed = true; -# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred. -blur-background = false; - -# Blur background of opaque windows with transparent frames as well. -# blur-background-frame = true; -# Do not let blur radius adjust based on window opacity. -blur-background-fixed = false; -blur-background-exclude = [ - "window_type = 'dock'", - "window_type = 'desktop'" -]; - -################################# -# -# Fading -# -################################# - -# Fade windows during opacity changes. -fading = false; -# The time between steps in a fade in milliseconds. (default 10). -fade-delta = 4; -# Opacity change between steps while fading in. (default 0.028). -fade-in-step = 0.03; -# Opacity change between steps while fading out. (default 0.03). -fade-out-step = 0.03; -# Fade windows in/out when opening/closing -# no-fading-openclose = true; - -# Specify a list of conditions of windows that should not be faded. -fade-exclude = [ ]; - -################################# -# -# Other -# -################################# - -# Try to detect WM windows and mark them as active. -mark-wmwin-focused = true; -# Mark all non-WM but override-redirect windows active (e.g. menus). -mark-ovredir-focused = true; -# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events. -# Usually more reliable but depends on a EWMH-compliant WM. -use-ewmh-active-win = true; -# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on. -detect-rounded-corners = true; - -# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows. -# This prevents opacity being ignored for some apps. -# For example without this enabled my xfce4-notifyd is 100% opacity no matter what. -detect-client-opacity = true; - -# Specify refresh rate of the screen. -# If not specified or 0, picom will try detecting this with X RandR extension. -refresh-rate = 0; - -# Vertical synchronization: match the refresh rate of the monitor -vsync = true; - -# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing. -# Reported to have no effect, though. -dbe = false; - -# Limit picom to repaint at most once every 1 / refresh_rate second to boost performance. -# This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already, -# unless you wish to specify a lower refresh rate than the actual value. -#sw-opti = true; - -# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games. -# Known to cause flickering when redirecting/unredirecting windows. -unredir-if-possible = false; - -# Specify a list of conditions of windows that should always be considered focused. -focus-exclude = [ ]; - -# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time. -detect-transient = true; -# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time. -# WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too. -detect-client-leader = true; - -################################# -# -# Window type settings -# -################################# - -wintypes: -{ - tooltip = - { - # fade: Fade the particular type of windows. - fade = true; - # shadow: Give those windows shadow - shadow = false; - # opacity: Default opacity for the type of windows. - opacity = 0.85; - # focus: Whether to always consider windows of this type focused. - focus = true; - }; -}; - -###################### -# -# XSync -# See: https://github.com/yshui/picom/commit/b18d46bcbdc35a3b5620d817dd46fbc76485c20d -# -###################### - -# Use X Sync fence to sync clients' draw calls. Needed on nvidia-drivers with GLX backend for some users. -xrender-sync-fence = true; +# Thank you code_nomad: http://9m.no/ꪯ鵞 +# and Arch Wiki contributors: https://wiki.archlinux.org/index.php/Compton + +################################# +# +# Backend +# +################################# + +# Backend to use: "xrender" or "glx". +# GLX backend is typically much faster but depends on a sane driver. +backend = "glx"; + +################################# +# +# GLX backend +# +################################# + +glx-no-stencil = true; + +# GLX backend: Copy unmodified regions from front buffer instead of redrawing them all. +# My tests with nvidia-drivers show a 10% decrease in performance when the whole screen is modified, +# but a 20% increase when only 1/4 is. +# My tests on nouveau show terrible slowdown. +glx-copy-from-front = false; + +# GLX backend: Use MESA_copy_sub_buffer to do partial screen update. +# My tests on nouveau shows a 200% performance boost when only 1/4 of the screen is updated. +# May break VSync and is not available on some drivers. +# Overrides --glx-copy-from-front. +# glx-use-copysubbuffermesa = true; + +# GLX backend: Avoid rebinding pixmap on window damage. +# Probably could improve performance on rapid window content changes, but is known to break things on some drivers (LLVMpipe). +# Recommended if it works. +# glx-no-rebind-pixmap = true; + +# GLX backend: GLX buffer swap method we assume. +# Could be undefined (0), copy (1), exchange (2), 3-6, or buffer-age (-1). +# undefined is the slowest and the safest, and the default value. +# copy is fastest, but may fail on some drivers, +# 2-6 are gradually slower but safer (6 is still faster than 0). +# Usually, double buffer means 2, triple buffer means 3. +# buffer-age means auto-detect using GLX_EXT_buffer_age, supported by some drivers. +# Useless with --glx-use-copysubbuffermesa. +# Partially breaks --resize-damage. +# Defaults to undefined. +#glx-swap-method = "undefined"; + +################################# +# +# Shadows +# +################################# + +# Enabled client-side shadows on windows. +shadow = false; +# The blur radius for shadows. (default 12) +shadow-radius = 5; +# The left offset for shadows. (default -15) +shadow-offset-x = -5; +# The top offset for shadows. (default -15) +shadow-offset-y = -5; +# The translucency for shadows. (default .75) +shadow-opacity = 0.5; + +# Set if you want different colour shadows +# shadow-red = 0.0; +# shadow-green = 0.0; +# shadow-blue = 0.0; + +# The shadow exclude options are helpful if you have shadows enabled. Due to the way picom draws its shadows, certain applications will have visual glitches +# (most applications are fine, only apps that do weird things with xshapes or argb are affected). +# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher. +shadow-exclude = [ + "! name~=''", + "name = 'Notification'", + "name = 'Plank'", + "name = 'Docky'", + "name = 'Kupfer'", + "name = 'xfce4-notifyd'", + "name *= 'VLC'", + "name *= 'compton'", + "name *= 'picom'", + "name *= 'Chromium'", + "name *= 'Chrome'", + "class_g = 'Firefox' && argb", + "class_g = 'Conky'", + "class_g = 'Kupfer'", + "class_g = 'Synapse'", + "class_g ?= 'Notify-osd'", + "class_g ?= 'Cairo-dock'", + "class_g ?= 'Xfce4-notifyd'", + "class_g ?= 'Xfce4-power-manager'", + "_GTK_FRAME_EXTENTS@:c", + "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" +]; +# Avoid drawing shadow on all shaped windows (see also: --detect-rounded-corners) +shadow-ignore-shaped = false; + +################################# +# +# Opacity +# +################################# + +inactive-opacity = 0.5; +active-opacity = 1; +frame-opacity = 1; +inactive-opacity-override = true; + +# Dim inactive windows. (0.0 - 1.0) +inactive-dim = 0.2; +# Do not let dimness adjust based on window opacity. +# inactive-dim-fixed = true; +# Blur background of transparent windows. Bad performance with X Render backend. GLX backend is preferred. +blur-background = false; +# Blur background of opaque windows with transparent frames as well. +blur-background-frame = false; +# Do not let blur radius adjust based on window opacity. +blur-background-fixed = false; +blur-background-exclude = [ + "window_type = 'dock'", +]; + +################################# +# +# Fading +# +################################# + +# Fade windows during opacity changes. +fading = false; +# The time between steps in a fade in milliseconds. (default 10). +fade-delta = 4; +# Opacity change between steps while fading in. (default 0.028). +fade-in-step = 0.03; +# Opacity change between steps while fading out. (default 0.03). +fade-out-step = 0.03; +# Fade windows in/out when opening/closing +# no-fading-openclose = true; + +# Specify a list of conditions of windows that should not be faded. +fade-exclude = [ ]; + +################################# +# +# Other +# +################################# + +# Try to detect WM windows and mark them as active. +mark-wmwin-focused = true; +# Mark all non-WM but override-redirect windows active (e.g. menus). +mark-ovredir-focused = true; +# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused instead of using FocusIn/Out events. +# Usually more reliable but depends on a EWMH-compliant WM. +use-ewmh-active-win = true; +# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on. +detect-rounded-corners = true; + +# Detect _NET_WM_OPACITY on client windows, useful for window managers not passing _NET_WM_OPACITY of client windows to frame windows. +# This prevents opacity being ignored for some apps. +# For example without this enabled my xfce4-notifyd is 100% opacity no matter what. +detect-client-opacity = true; + +# Specify refresh rate of the screen. +# If not specified or 0, picom will try detecting this with X RandR extension. +refresh-rate = 0; + +# Vertical synchronization: match the refresh rate of the monitor +vsync = true; + +# Enable DBE painting mode, intended to use with VSync to (hopefully) eliminate tearing. +# Reported to have no effect, though. +dbe = false; + +# Limit picom to repaint at most once every 1 / refresh_rate second to boost performance. +# This should not be used with --vsync drm/opengl/opengl-oml as they essentially does --sw-opti's job already, +# unless you wish to specify a lower refresh rate than the actual value. +#sw-opti = true; + +# Unredirect all windows if a full-screen opaque window is detected, to maximize performance for full-screen windows, like games. +# Known to cause flickering when redirecting/unredirecting windows. +unredir-if-possible = false; + +# Specify a list of conditions of windows that should always be considered focused. +focus-exclude = [ ]; + +# Use WM_TRANSIENT_FOR to group windows, and consider windows in the same group focused at the same time. +detect-transient = true; +# Use WM_CLIENT_LEADER to group windows, and consider windows in the same group focused at the same time. +# WM_TRANSIENT_FOR has higher priority if --detect-transient is enabled, too. +detect-client-leader = true; + +################################# +# +# Window type settings +# +################################# + +wintypes: +{ + tooltip = + { + # fade: Fade the particular type of windows. + fade = true; + # shadow: Give those windows shadow + shadow = false; + # opacity: Default opacity for the type of windows. + opacity = 0.85; + # focus: Whether to always consider windows of this type focused. + focus = true; + }; +}; + +###################### +# +# XSync +# See: https://github.com/yshui/picom/commit/b18d46bcbdc35a3b5620d817dd46fbc76485c20d +# +###################### + +# Use X Sync fence to sync clients' draw calls. Needed on nvidia-drivers with GLX backend for some users. +xrender-sync-fence = true; diff --git a/polybar/config b/polybar/config index e7a72b7..e775daf 100644 --- a/polybar/config +++ b/polybar/config @@ -1,290 +1,197 @@ -; color format is in ARGB +; Main color format is in ARGB. +; However, formats in RGB is fine. +; This is where all of the colors should be placed for those who are lazy to scroll down (like me). [colors] -background = #000000 -background-alt = #99000000 -foreground = ${xrdb:color7:#eee} -foreground-alt = #aaa -primary = #d59783 -secondary = #E8C4FF -tertiary = #A7DAE8 -alert = #bd2c40 + background = #000 + foreground = #eee + + module_prefix_bg = ${xrdb:color1:#ccc} + module_prefix_fg = ${xrdb:color15:#000} + module_bg = ${xrdb:color15:#fff} + module_fg = ${xrdb:color0:#000} + + vol_module_bg = #ff9f1c + network_module_bg = #2ec4b6 + date_module_bg = #99d122 + memory_module_bg = #1a1b41 - - -; The common style between bars +; The common style between bars. [bar-common-style] -width = 100% -height = 30 -wm-restack = bspwm -fixed-center = false + width = 100% + height = 32 + wm-restack = bspwm + fixed-center = false -line-size = 3 -line-color = #f00 + line-size = 3 + line-color = #f00 -padding = 1 + padding = 1 -module-margin = 1 + module-margin = 1 + module-padding = 1 -font-0 = "Iosevka" -font-1 = "Fira Code" -font-2 = siji:pixelsize=10;1 - -tray-position = right -tray-padding = 2 -cursor-click = pointer + font-0 = "Iosevka" + font-1 = "Fira Code" + font-2 = "Noto Color Emoji:style=Regular:scale=10;1" + ; This creates the illusion as if the modules are in the center. + __border-size = 5 + border-top-size = ${self.__border-size} + border-top-color = ${colors.background} + border-bottom-size = ${self.__border-size} + border-bottom-color = ${colors.background} + + tray-position = right + tray-padding = 1 + cursor-click = pointer +; Common style between modules. [module-common-style] -format-padding = 1 -format-background = ${colors.background-alt} -format-prefix-foreground = ${colors.foreground-alt} - - + label-padding = 1 + format-foreground = ${colors.background} + format-background = ${colors.foreground} + format-prefix-padding = 1 + format-prefix-foreground = ${colors.module_prefix_fg} + format-prefix-background = ${colors.module_prefix_bg} +; The main bar. [bar/fds-bar] -background = ${colors.background} -foreground = ${colors.foreground} + background = ${colors.background} + foreground = ${colors.foreground} -inherit = bar-common-style -enable-ipc = true -modules-left = bspwm -modules-right = pulseaudio memory cpu temperature eth date powermenu - - - - -[bar/fds-taskbar] -background = ${colors.background} -foreground = ${colors.foreground} - -inherit = bar-common-style -bottom = true -modules-left = xwindow -modules-right = filesystem - - - -[module/conv] -type = custom/text -content = "terminal" -click-left = "tdrop -ma -s dropdown alacritty" + inherit = bar-common-style + enable-ipc = true + modules-left = bspwm + modules-center = xwindow + modules-right = pulseaudio memory eth date menu-apps counter [module/xwindow] -type = internal/xwindow -label = " %title:0:100:...% " -label-layout = %layout% -format =