From b7b643ddf9ac5b79f6f9ae08413b7d357ee1ddbd Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 22 Feb 2025 18:12:57 +0100 Subject: [PATCH 01/13] jj: Add aliases to jump to most recent changes `jed` allows editing the 'latest' (i.e. most recent, timewise) change we can reach following the descendants of the current working copy. In essence, this allows us to quickly jump to the head of whatever branch we are on. Similarly, `jet` goes to the newest descendant of the 'trunk' branch (i.e. generally 'master' or 'main'). And `jel` just goes to the newest commit in general out of all commits in the repo. These have a lot of overlap and I might end up removing the latter two if I am not using them much, which may be the case. --- vcs/jj/config/sh/alias.d/jj.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vcs/jj/config/sh/alias.d/jj.sh b/vcs/jj/config/sh/alias.d/jj.sh index 8e1c841..c40349e 100644 --- a/vcs/jj/config/sh/alias.d/jj.sh +++ b/vcs/jj/config/sh/alias.d/jj.sh @@ -25,6 +25,13 @@ alias jen="jj next --edit" alias jep="jj prev --edit" alias jenn="jj next" alias jepp="jj prev" +# edit the 'newest' head descendant of current working copy +# usually means 'get me to head of current branch' +alias jed="jj edit -r 'latest(heads(descendants(@)))'" +# go to the newest head of the trunk branch +alias jet="jj edit -r 'latest(heads(descendants(trunk())))'" +# simply go to the newest commit, i.e. our last change committed +alias jel="jj edit -r 'latest(all())'" # for squash-and-go workflows # https://steveklabnik.github.io/jujutsu-tutorial/real-world-workflows/the-squash-workflow.html From 4c867d6564e6416e9f709580d3bda9dad03eb425 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 22 Feb 2025 18:12:57 +0100 Subject: [PATCH 02/13] bootstrap: Remove virtualbox packages Have not used them for absolute ages, ever since switching to a combination of virt-manager, libvirt, qemu and incus. --- bootstrap/packages_stable.tsv | 2 -- 1 file changed, 2 deletions(-) diff --git a/bootstrap/packages_stable.tsv b/bootstrap/packages_stable.tsv index b98f22d..17455fd 100644 --- a/bootstrap/packages_stable.tsv +++ b/bootstrap/packages_stable.tsv @@ -341,8 +341,6 @@ vifm A file manager with curses interface, which provides Vi[m]-like environment vim-language-server VimScript language server A vimiv-qt-git An image viewer with vim-like keybindings A virt-manager Desktop user interface for managing virtual machines R -virtualbox Powerful x86 virtualization for enterprise as well as home use R -virtualbox-guest-iso The official VirtualBox Guest Additions ISO image R visidata Terminal spreadsheet multitool for discovering and arranging data R viu Simple terminal image viewer R wallabag-client Command line client for the self hosted read-it-later app Wallabag A From 987e4459bfa9e03345f76cfcc596ae9f157e5411 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 22 Feb 2025 21:27:49 +0100 Subject: [PATCH 03/13] qutebrowser: Manually redirect youtube Since farside is apparently also not capable of correctly redirecting to invidious (the one functioning instance), we are doing it manually. --- qutebrowser/config/freedirect/freedirect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/config/freedirect/freedirect.py b/qutebrowser/config/freedirect/freedirect.py index 0b2999c..b32717d 100644 --- a/qutebrowser/config/freedirect/freedirect.py +++ b/qutebrowser/config/freedirect/freedirect.py @@ -48,7 +48,6 @@ def breezewiki_host_to_path(url: QUrl): default_services = [ - Service(source=["youtube.com"], target=["invidious"]), Service(source=["stackoverflow.com"], target=["anonymousoverflow"]), Service(source=["odysee.com"], target=["librarian"]), Service(source=["reddit.com"], target=["redlib"]), @@ -68,6 +67,7 @@ default_services = [ Service(source=["translate.google.com"], target=["lingva", "simplytranslate"]), Service(source=["deepl.com"], target=["simplytranslate"]), Service(source=["bandcamp.com"], target=["tent"]), + Service(custom_targets=True, source=["youtube.com"], target=["inv.nadeko.net"]), Service( custom_targets=True, source=["genius.com"], From dd62c8a2d07a149f71e3c93d945d524ce068db07 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 23 Feb 2025 00:53:49 +0100 Subject: [PATCH 04/13] river: Automatically choose layout engine Prefers filtile as layouting engine but falls back to rivertile if it does not find it. --- desktop/.config/river/init | 49 ++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/desktop/.config/river/init b/desktop/.config/river/init index dcf40a2..093fc0b 100755 --- a/desktop/.config/river/init +++ b/desktop/.config/river/init @@ -3,11 +3,24 @@ mod="Mod4" modemod="Mod1" term=${TERMINAL:-foot} -layout="filtile" time_to_lockscreen=300 time_to_screendim=600 time_to_suspend=900 +layout_cmd="rivertile" +layout_opt="-main-ratio 0.65\ + -outer-padding 0\ + -view-padding 6" + +if command -v filtile >/dev/null 2>&1; then + layout_cmd="filtile" + layout_opt="--tags all --output all main-ratio 0.65,\ + --tags all --output all view-padding 6,\ + --tags all --output all outer-padding 0,\ + --tags all --output all smart-padding on,\ + --tags all --output all smart-padding 0" +fi + NO_RESTART="$1" should_start() { # 1=program binary name # not running, start @@ -129,10 +142,10 @@ riverctl map normal $mod+Shift K swap previous riverctl map normal $mod+Shift Return zoom # change layout orientation -riverctl map normal $mod Up send-layout-cmd $layout "main-location top" -riverctl map normal $mod Right send-layout-cmd $layout "main-location right" -riverctl map normal $mod Down send-layout-cmd $layout "main-location bottom" -riverctl map normal $mod Left send-layout-cmd $layout "main-location left" +riverctl map normal $mod Up send-layout-cmd $layout_cmd "main-location top" +riverctl map normal $mod Right send-layout-cmd $layout_cmd "main-location right" +riverctl map normal $mod Down send-layout-cmd $layout_cmd "main-location bottom" +riverctl map normal $mod Left send-layout-cmd $layout_cmd "main-location left" # snap views to screen edges riverctl map normal $mod+Control H snap left @@ -143,8 +156,8 @@ riverctl map normal $mod+Control L snap right # Mod+F to toggle fullscreen riverctl map normal $mod F toggle-fullscreen # if we are running filtile we also have access to monocle mode -if [ "$layout" = "filtile" ]; then - riverctl map normal $mod+Shift F spawn "riverctl send-layout-cmd $layout monocle" +if [ "$layout_cmd" = "filtile" ]; then + riverctl map normal $mod+Shift F spawn "riverctl send-layout-cmd $layout_cmd monocle" fi riverctl map normal $mod+Shift v toggle-float @@ -153,8 +166,8 @@ riverctl map normal $mod+Shift v toggle-float # Make all connected outputs show the desktop and no windows at all riverctl map normal $mod+Shift M spawn 'for i in $(wlopm | wc -l); do riverctl set-focused-tags $((1 << 10)); riverctl focus-output next; done; riverctl set-focused-tags $((1 << 10)); riverctl focus-output next' -riverctl map normal $mod+Shift F10 spawn "riverctl send-layout-cmd $layout '--tags all --output all view-padding 0'" -riverctl map normal $mod F10 spawn "riverctl send-layout-cmd $layout '--tags all --output all view-padding 6'" +riverctl map normal $mod+Shift F10 spawn "riverctl send-layout-cmd $layout_cmd '--tags all --output all view-padding 0'" +riverctl map normal $mod F10 spawn "riverctl send-layout-cmd $layout_cmd '--tags all --output all view-padding 6'" # Mod + Left Mouse Button to move views riverctl map-pointer normal $mod BTN_LEFT move-view @@ -179,11 +192,11 @@ riverctl map -repeat interact_float $mod J resize vertical 100 riverctl map -repeat interact_float $mod K resize vertical -100 riverctl map -repeat interact_float $mod L resize horizontal 100 # decrease/increase the main ratio of layout -riverctl map interact_float $mod+Shift H send-layout-cmd $layout "main-ratio -0.05" -riverctl map interact_float $mod+Shift L send-layout-cmd $layout "main-ratio +0.05" +riverctl map interact_float $mod+Shift H send-layout-cmd $layout_cmd "main-ratio -0.05" +riverctl map interact_float $mod+Shift L send-layout-cmd $layout_cmd "main-ratio +0.05" # increment/decrement the main layout -riverctl map interact_float $mod+Shift J send-layout-cmd $layout "main-count +1" -riverctl map interact_float $mod+Shift K send-layout-cmd $layout "main-count -1" +riverctl map interact_float $mod+Shift J send-layout-cmd $layout_cmd "main-count +1" +riverctl map interact_float $mod+Shift K send-layout-cmd $layout_cmd "main-count -1" # snap views to screen edges riverctl map interact_float $mod+Control H snap left riverctl map interact_float $mod+Control J snap down @@ -334,12 +347,8 @@ should_start wl-paste && riverctl spawn "wl-paste -t text --watch clipman store" # killall polkit-gnome-authentication-agent-1 # /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & # start layouting engine -killall $layout -riverctl spawn "$layout --tags all --output all main-ratio 0.65,\ - --tags all --output all view-padding 6,\ - --tags all --output all outer-padding 0,\ - --tags all --output all smart-padding on,\ - --tags all --output all smart-padding 0" +killall $layout_cmd +riverctl spawn "$layout_cmd $layout_opt" # River will send the process group of the init executable SIGTERM on exit. -riverctl default-layout $layout +riverctl default-layout $layout_cmd brightnessctl set 70% From af7aaa068ca9e46f4e665085fe8bb7baab4530ce Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 23 Feb 2025 13:40:40 +0100 Subject: [PATCH 05/13] eza: Fix aliases pointing to old exa executable --- sh/.config/sh/alias | 14 +++++++------- terminal/.config/vifm/vifmrc | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sh/.config/sh/alias b/sh/.config/sh/alias index 5ac00fa..21a296e 100644 --- a/sh/.config/sh/alias +++ b/sh/.config/sh/alias @@ -20,15 +20,15 @@ fi alias :q="exit" # ls defaults -if exist exa; then - alias l="exa -l --git --git-ignore --group-directories-first" - alias L="exa -hal --grid --git --group-directories-first" +if exist eza; then + alias l="eza -l --git --git-ignore --group-directories-first" + alias L="eza -hal --grid --git --group-directories-first" # a recursive tree # - usually want to change levels recursed with -L2 -L3 or similar - alias ll="exa --tree -L2 --group-directories-first" - alias LL="exa -a --tree -L2 --group-directories-first" - alias lla="exa --tree --group-directories-first" - alias LLA="exa -a --tree --group-directories-first" + alias ll="eza --tree -L2 --group-directories-first" + alias LL="eza -a --tree -L2 --group-directories-first" + alias lla="eza --tree --group-directories-first" + alias LLA="eza -a --tree --group-directories-first" else alias l="ls -lhF" alias L="ls -lAhF" diff --git a/terminal/.config/vifm/vifmrc b/terminal/.config/vifm/vifmrc index 80e172f..a667bdb 100644 --- a/terminal/.config/vifm/vifmrc +++ b/terminal/.config/vifm/vifmrc @@ -613,7 +613,7 @@ filextype */ \ {View in thunar} \ Thunar %f &, fileviewer */ - \ exa --color always --tree -L2, + \ eza --color always --tree -L2, \ tree -L 2, " markdown text From b8bc65dfabe7374b7dd94aeaf75d0d635f9aef86 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 23 Feb 2025 13:37:55 +0100 Subject: [PATCH 06/13] qutebrowser: Add void packages to searchengines Using `void ` the void package repositories can now be searched. --- qutebrowser/config/searchengines.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qutebrowser/config/searchengines.py b/qutebrowser/config/searchengines.py index 42dab38..b663120 100644 --- a/qutebrowser/config/searchengines.py +++ b/qutebrowser/config/searchengines.py @@ -24,6 +24,7 @@ c.url.searchengines = { "r": "https://www.reddit.com/r/{}", "sci": "https://sci-hub.ru/{}", "t": "https://www.thesaurus.com/browse/{}", + "void": "https://voidlinux.org/packages/?q={}", "w": "https://en.wikipedia.org/w/index.php?search={}", "yt": "https://yewtu.be/search?q={}", } From e3742d43ec60d99682bcb5e6af5ba6e434ba86cc Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 23 Feb 2025 13:37:55 +0100 Subject: [PATCH 07/13] fonts: Fix for Iosevka on Voidlinux Prefer regular 'Iosevka' font in most cases, not the highly specific 'Iosevka Nerd Font'. This may break some things back in Archlinux-land but it is required for iosevka to be correctly displayed in Voidlinux, and, to be honest, also feels more clean than using such a highly specialized font for everything. Additionally, we generally make use of both where possible, defaulting to the more specific 'Nerd Font' family variant but falling back to regular old Iosevka. One exception is 'wezterm' which, though it nicely includes a font fallback option (and a very configurable one at that), _always_ produces a warning when the first font in a fallback list is not found -- even when the specific 'warn_about_missing_glyphs' option is ticked. No clue why but for now this works well enough for me. --- desktop/.config/fontconfig/fonts.conf | 5 ++++- multimedia/.config/mpv/mpv.conf | 2 +- qutebrowser/config/config.py | 4 ++++ terminal/.config/wezterm/wezterm.lua | 27 ++++++++++++++------------- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/desktop/.config/fontconfig/fonts.conf b/desktop/.config/fontconfig/fonts.conf index 3dc933d..1fd66d3 100644 --- a/desktop/.config/fontconfig/fonts.conf +++ b/desktop/.config/fontconfig/fonts.conf @@ -11,7 +11,10 @@ monospace - Iosevka Nerd Font + + Iosevka Nerd Font + Iosevka + fantasy diff --git a/multimedia/.config/mpv/mpv.conf b/multimedia/.config/mpv/mpv.conf index 302d642..fd148db 100644 --- a/multimedia/.config/mpv/mpv.conf +++ b/multimedia/.config/mpv/mpv.conf @@ -35,7 +35,7 @@ screenshot-tag-colorspace=yes osc=no osd-bar=no -osd-font='Iosevka Nerd Font' +osd-font='Iosevka' osd-font-size=15 ### Subtitles diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index a2d97ae..6697977 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -75,6 +75,10 @@ c.tabs.show = "multiple" c.tabs.show_switching_delay = 2000 c.statusbar.show = "always" +c.fonts.default_family = "Iosevka" +c.fonts.web.family.fixed = "Iosevka" +c.fonts.web.family.standard = "Iosevka" + c.colors.webpage.bg = "#555555" # Prevents *all* tabs from being loaded on restore, only loads on activating them diff --git a/terminal/.config/wezterm/wezterm.lua b/terminal/.config/wezterm/wezterm.lua index 01ba9a5..eb70a5b 100644 --- a/terminal/.config/wezterm/wezterm.lua +++ b/terminal/.config/wezterm/wezterm.lua @@ -34,33 +34,34 @@ local settings = { color_scheme = "Nord (base16)", -- will be overwritten by colors -- default_prog = {"nu"}, scrollback_lines = 10000, - font = wezterm.font("Iosevka Nerd Font"), + font = wezterm.font_with_fallback({ + { family = "Iosevka", weight = "Regular", italic = false }, + { family = "Iosevka Nerd Font", weight = "Regular", italic = false }, + }), -- add cursive italic font from Victor font for all weights font_rules = { { - intensity = "Bold", italic = true, - font = wezterm.font({ - family = "VictorMono Nerd Font", - weight = "Bold", - style = "Italic", + intensity = "Bold", + font = wezterm.font_with_fallback({ + { family = "Iosevka", weight = "Bold", italic = true }, + { family = "VictorMono Nerd Font", weight = "Bold", style = "Italic" }, }), }, { italic = true, intensity = "Half", - font = wezterm.font({ - family = "VictorMono Nerd Font", - weight = "DemiBold", - style = "Italic", + font = wezterm.font_with_fallback({ + { family = "Iosevka", weight = "DemiBold", italic = true }, + { family = "VictorMono Nerd Font", weight = "DemiBold", style = "Italic" }, }), }, { italic = true, intensity = "Normal", - font = wezterm.font({ - family = "VictorMono Nerd Font", - style = "Italic", + font = wezterm.font_with_fallback({ + { family = "Iosevka", weight = "Bold", italic = true }, + { family = "VictorMono Nerd Font", style = "Italic" }, }), }, }, From 1aa94aa866c2600a37016e133e68a08373ac7d34 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 23 Feb 2025 20:03:58 +0100 Subject: [PATCH 08/13] HACK: river: Autostart pipewire on non-systemd systems This is a temporary adjustment to start pipewire as a user process when river starts up, targeting my new voidlinux installation. Ideally, we want to have runit user services up and running and being responsible for maintaining a running pipewire instance but until that is set up we can simply start it with river. --- desktop/.config/river/init | 2 ++ 1 file changed, 2 insertions(+) diff --git a/desktop/.config/river/init b/desktop/.config/river/init index 093fc0b..c219a99 100755 --- a/desktop/.config/river/init +++ b/desktop/.config/river/init @@ -343,6 +343,8 @@ should_start swayidle && riverctl spawn "swayidle \ should_start wl-paste && riverctl spawn "wl-paste -t text --watch clipman store" +should_start pipewire && riverctl spawn pipewire + # bash ~/.config/bin/gtktheme # setting our gtk variables # killall polkit-gnome-authentication-agent-1 # /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 & From f04340acbdfc203c54e4d72f0ac30cd58ef030da Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 23 Feb 2025 21:06:50 +0100 Subject: [PATCH 09/13] zsh: Use zr plugin manager if it exists By default we use the 'zr' plugin manager for zsh. It is quick and painless and takes managing the plugins across two environments not our problem anymore. --- terminal/.config/zsh/.zshrc | 93 +++++++++++++++++++++++++------------ 1 file changed, 63 insertions(+), 30 deletions(-) diff --git a/terminal/.config/zsh/.zshrc b/terminal/.config/zsh/.zshrc index 898652b..77254c7 100644 --- a/terminal/.config/zsh/.zshrc +++ b/terminal/.config/zsh/.zshrc @@ -1,5 +1,4 @@ #!/usr/bin/env zsh -# CONFDIR="${XDG_CONFIG_HOME:-$HOME/.config}" ZSHCONFDIR="$CONFDIR/zsh" @@ -17,20 +16,36 @@ zstyle :compinstall filename "$ZSHCONFDIR/.zshrc" compinit # End of lines added by compinstall -# load plugins -[ -e /usr/share/oh-my-zsh/plugins/colored-man-pages/colored-man-pages.plugin.zsh ] && source /usr/share/oh-my-zsh/plugins/colored-man-pages/colored-man-pages.plugin.zsh -[ -e /usr/share/oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh ] && source /usr/share/oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh -[ -e /usr/share/fzf/key-bindings.zsh ] && source /usr/share/fzf/key-bindings.zsh -#source /usr/share/nvm/init-nvm.sh -## find the correct installed tab-completion version -PLUG_FOLDER="/usr/share/zsh/plugins" -[ -e $PLUG_FOLDER/fzf-tab/fzf-tab.plugin.zsh ] && source $PLUG_FOLDER/fzf-tab/fzf-tab.plugin.zsh -[ -e $PLUG_FOLDER/fzf-tab-bin-git/fzf-tab.plugin.zsh ] && source $PLUG_FOLDER/fzf-tab-bin-git/fzf-tab.plugin.zsh -# these need to be sourced after fzf-tab -[ -e $PLUG_FOLDER/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh ] && source $PLUG_FOLDER/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh -[ -e $PLUG_FOLDER/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ] && source $PLUG_FOLDER/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -[ -e $PLUG_FOLDER/alias-tips/alias-tips.plugin.zsh ] && source $PLUG_FOLDER/alias-tips/alias-tips.plugin.zsh -[ -e $PLUG_FOLDER/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh ] && source $PLUG_FOLDER/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh +# load plugins with the zr plugin manager +AUTO_NOTIFY_THRESHOLD=60 +TIPZ_TEXT='ALIAS:' +if command -v zr >/dev/null 2>&1; then + . <( + zr \ + molovo/tipz \ + ael-code/zsh-colored-man-pages \ + MichaelAquilina/zsh-auto-notify \ + junegunn/fzf.git/shell/key-bindings.zsh \ + Aloxaf/fzf-tab \ + zdharma-continuum/fast-syntax-highlighting \ + zsh-users/zsh-autosuggestions \ + zsh-users/zsh-completions \ + ) + +else # or manually + [ -e /usr/share/oh-my-zsh/plugins/colored-man-pages/colored-man-pages.plugin.zsh ] && source /usr/share/oh-my-zsh/plugins/colored-man-pages/colored-man-pages.plugin.zsh + [ -e /usr/share/oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh ] && source /usr/share/oh-my-zsh/plugins/command-not-found/command-not-found.plugin.zsh + [ -e /usr/share/fzf/key-bindings.zsh ] && source /usr/share/fzf/key-bindings.zsh + ## find the correct installed tab-completion version + PLUG_FOLDER="/usr/share/zsh/plugins" + [ -e $PLUG_FOLDER/fzf-tab/fzf-tab.plugin.zsh ] && source $PLUG_FOLDER/fzf-tab/fzf-tab.plugin.zsh + [ -e $PLUG_FOLDER/fzf-tab-bin-git/fzf-tab.plugin.zsh ] && source $PLUG_FOLDER/fzf-tab-bin-git/fzf-tab.plugin.zsh + # these need to be sourced after fzf-tab + [ -e $PLUG_FOLDER/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh ] && source $PLUG_FOLDER/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh + [ -e $PLUG_FOLDER/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ] && source $PLUG_FOLDER/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh + [ -e $PLUG_FOLDER/alias-tips/alias-tips.plugin.zsh ] && source $PLUG_FOLDER/alias-tips/alias-tips.plugin.zsh + [ -e $PLUG_FOLDER/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh ] && source $PLUG_FOLDER/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh +fi unset PLUG_FOLDER # simple fzf-tab settings @@ -39,7 +54,18 @@ zstyle ":fzf-tab:*" fzf-flags "--ansi" "--expect='$continuous_trigger,$print_que zstyle ':fzf-tab:*' fzf-command fzf # format colorful groups for different completion actions zstyle ':completion:*:descriptions' format '[%d]' -zstyle ':fzf-tab:*' show-group brief +# set list-colors to enable filename colorizing + +zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} +# force zsh not to show completion menu, which allows fzf-tab to capture the unambiguous prefix +zstyle ':completion:*' menu no + +# fzf-tab does not follow FZF_DEFAULT_OPTS by default since some setups can break completion +zstyle ':fzf-tab:*' fzf-flags --color=fg:1,fg+:2 +zstyle ':fzf-tab:*' fzf-bindings 'ctrl-j:accept' 'ctrl-a:toggle-all' 'ctrl-d:preview-down' 'ctrl-u:preview-up' +zstyle ':fzf-tab:*' continuous-trigger '/' +zstyle ':fzf-tab:*' switch-group '<' '>' + # use input as query string when completing zlua zstyle ':fzf-tab:complete:_zlua:*' query-string input # (experimental, may change in the future) @@ -55,10 +81,17 @@ local realpath=\${ctxt[IPREFIX]}\${ctxt[hpre]}\$in realpath=\${(Qe)~realpath} " # give a preview of commandline arguments when completing `kill` -zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm,cmd -w -w" -zstyle ':fzf-tab:complete:kill:argument-rest' extra-opts --preview=$extract'ps --pid=$in[(w)1] -o cmd --no-headers -w -w' --preview-window=down:3:wrap -# give a preview of directory by exa when completing cd -zstyle ':fzf-tab:complete:cd:*' extra-opts --preview=$extract'exa -1 --color=always $realpath' +zstyle ':completion:*:*:*:*:processes' command "ps -u $USER -o pid,user,comm -w -w" +zstyle ':fzf-tab:complete:(kill|ps):argument-rest' fzf-preview \ + '[[ $group == "[process ID]" ]] && ps --pid=$word -o cmd --no-headers -w -w' +zstyle ':fzf-tab:complete:(kill|ps):argument-rest' fzf-flags --preview-window=down:3:wrap +# preview directory's content with eza when completing cd +zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath' +# show systemd unit status +zstyle ':fzf-tab:complete:systemctl-*:*' fzf-preview 'SYSTEMD_COLORS=1 systemctl status $word' +# env var contents +zstyle ':fzf-tab:complete:(-command-|-parameter-|-brace-parameter-|export|unset|expand):*' \ + fzf-preview 'echo ${(P)word}' # show hostname if we are in a distrobox environment if [ -n "$DISTROBOX_ENTER_PATH" ] && [ -f /run/.containerenv ]; then @@ -154,21 +187,21 @@ bindkey -v export KEYTIMEOUT=1 # Change cursor shape for different vi modes. function zle-keymap-select { - if [[ ${KEYMAP} == vicmd ]] || - [[ $1 = 'block' ]]; then - echo -ne '\e[2 q' + if [[ ${KEYMAP} == vicmd ]] || + [[ $1 = 'block' ]]; then + echo -ne '\e[2 q' - elif [[ ${KEYMAP} == main ]] || - [[ ${KEYMAP} == viins ]] || - [[ ${KEYMAP} = '' ]] || - [[ $1 = 'beam' ]]; then - echo -ne '\e[6 q' - fi + elif [[ ${KEYMAP} == main ]] || + [[ ${KEYMAP} == viins ]] || + [[ ${KEYMAP} = '' ]] || + [[ $1 = 'beam' ]]; then + echo -ne '\e[6 q' + fi } zle -N zle-keymap-select # Use beam shape cursor on startup. _fix_cursor() { - echo -ne '\e[6 q' + echo -ne '\e[6 q' } precmd_functions+=(_fix_cursor) From 528a4e7fce7ed208b884c7778acc94955aee46b3 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 23 Feb 2025 22:15:18 +0100 Subject: [PATCH 10/13] sh: Add bat to cat alias Always call `bat` when we invoke `cat`. There is not ever a time when I want to use the bog standard `cat` in preference to `bat`. However, on the very slight off-chance there is, we still have a fallback alias on `rcat` which invokes 'raw' cat instead. --- sh/.config/sh/alias.d/batcat.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 sh/.config/sh/alias.d/batcat.sh diff --git a/sh/.config/sh/alias.d/batcat.sh b/sh/.config/sh/alias.d/batcat.sh new file mode 100644 index 0000000..36403e7 --- /dev/null +++ b/sh/.config/sh/alias.d/batcat.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env sh +# Make cat actually call bat if it exists. +# Give `rcat` as 'rawcat' replacement if needed. +# +# Mostly taken from https://github.com/fdellwing/zsh-bat +# sans MANPAGER +# +# shellcheck disable=SC2139 # (Expands when defined not used) +# We actively want it to check when defined so this is fine. + +# Save the original system `cat` under `rcat` +alias rcat="$(which cat)" +if command -v batcat >/dev/null 2>&1; then + # For Ubuntu and Debian-based `bat` packages + # the `bat` program is named `batcat` on these systems + alias cat="$(which batcat)" +elif command -v bat >/dev/null 2>&1; then + # For all other systems + alias cat="$(which bat)" +fi From cbea1efbc061bfcecc71a9c43f9a82f5dfeb78c9 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 23 Feb 2025 23:21:23 +0100 Subject: [PATCH 11/13] vcs: Update user commit signing email Changed to my more up-to-date main method of contact. --- vcs/git/config/git/config | 2 +- vcs/jj/config/jj/config.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vcs/git/config/git/config b/vcs/git/config/git/config index 6164279..2135a29 100644 --- a/vcs/git/config/git/config +++ b/vcs/git/config/git/config @@ -1,5 +1,5 @@ [user] - email = marty.oehme@gmail.com + email = contact@martyoeh.me name = Marty Oehme signingkey = 73BA40D5AFAF49C9 [init] diff --git a/vcs/jj/config/jj/config.toml b/vcs/jj/config/jj/config.toml index 520db74..3b87200 100644 --- a/vcs/jj/config/jj/config.toml +++ b/vcs/jj/config/jj/config.toml @@ -1,5 +1,5 @@ [user] -email = "marty.oehme@gmail.com" +email = "contact@martyoeh.me" name = "Marty Oehme" [signing] From 6af3ba52dc1b8332214147c1d3d5a20348d1e18a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 23 Feb 2025 23:21:23 +0100 Subject: [PATCH 12/13] qutebrowser: Add shellcheck search engine Just run `sc ` and you will instantly be beamed to the correcsponding shellcheck wiki error page. E.g. `sc 3001` will transport you to 'In POSIX sh, process substitution is undefined'. --- qutebrowser/config/searchengines.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qutebrowser/config/searchengines.py b/qutebrowser/config/searchengines.py index b663120..e1f9824 100644 --- a/qutebrowser/config/searchengines.py +++ b/qutebrowser/config/searchengines.py @@ -22,6 +22,7 @@ c.url.searchengines = { "pcw": "https://www.pcgamingwiki.com/w/index.php?search={}", "py": "https://pypi.org/search/?q={}", "r": "https://www.reddit.com/r/{}", + "sc": "https://www.shellcheck.net/wiki/SC{}", "sci": "https://sci-hub.ru/{}", "t": "https://www.thesaurus.com/browse/{}", "void": "https://voidlinux.org/packages/?q={}", From 1d2dbc0df2c724eb9e3352298a8b76b1ae35b978 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sun, 23 Feb 2025 23:21:23 +0100 Subject: [PATCH 13/13] git: Update basic git-bug aliases Update for newer git-bug versions (compiled from main trunk not tags). --- vcs/git/config/sh/alias.d/git.sh | 33 +++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/vcs/git/config/sh/alias.d/git.sh b/vcs/git/config/sh/alias.d/git.sh index 29679c3..b4153f6 100644 --- a/vcs/git/config/sh/alias.d/git.sh +++ b/vcs/git/config/sh/alias.d/git.sh @@ -98,21 +98,28 @@ else fi if exist git-bug; then - gb() { - if [ "$#" -eq 1 ]; then - git bug show "$1" - else - git bug ls "$@" - fi - } - alias gbt='git bug termui' + # POSIX-compliant version of . <(cmd) substitution + # shellcheck source=/dev/null # but shellcheck can't access + git-bug completion zsh | . /dev/fd/0 - alias gba='git bug add' - alias gbm='git bug comment add' - alias gbc='git bug status close' + alias gbt='git-bug termui' + alias gb="git-bug bug" + alias gbw="git-bug bug show" - alias gbp='git bug push' - alias gbl='git bug pull' + alias gbn='git-bug bug new' + alias gbm='git-bug bug comment new' + alias gbte='git-bug bug title edit' + + # TODO: Implement toggle function + # grab current status and then open or close accordingly + alias gbo='git-bug bug status close' + + alias gbp='git-bug push' + alias gbl='git-bug pull' + + alias gbu='git-bug user' # list users + # show primary user info + alias gbU='git-bug user user "$(git-bug user | cut -d" " -f1 | head -n1)"' fi unset -v git_version