Commit Diff


commit - 6feee7d6ad31b0b2185ed57342a88d3e570bb981
commit + 13ca9149cab8dbcf47f92acca2bc499c65472a20
blob - 74b70f5655202a8c014c0e03f448da30f164722a
blob + 4e4db323f26091aefe11d842fb702afc2f53479d
--- hosts/impish/default.nix
+++ hosts/impish/default.nix
@@ -105,6 +105,9 @@
         stgit
         git-annex
         actionlint
+        gitu
+        mergiraf
+        git-toolbelt
       ];
 
       net = [
@@ -150,6 +153,7 @@
         harper
         odiff
         mympd
+        fancy-cat
       ];
 
       ansible = [
@@ -270,7 +274,7 @@
         xnviewmp
         tigervnc
         dupeguru
-        iaito
+        fsearch
       ];
 
       other = [
blob - f681cda2dec4d8571d7993a81d215c31c35f77eb
blob + cd49b6e10f45035807ccf3c58695c0a331ee732a
Binary files hosts/impish/overlays/config/magdalena/config.json.nix and hosts/impish/overlays/config/magdalena/config.json.nix differ
blob - 887b7790858b26a9b950a287dceeb204f418e829
blob + fdf883dfbd71fa616fab66e4feab29356c21e5a9
Binary files hosts/impish/overlays/config/plakar/sources.yml and hosts/impish/overlays/config/plakar/sources.yml differ
blob - bd31f34b704d55e4b151d3f04d376feabfafe411
blob + 4458ed88dbde755d3f65957b32b9d1cde728de5e
Binary files hosts/impish/overlays/config/shell/rc/imp and hosts/impish/overlays/config/shell/rc/imp differ
blob - 8e90cab875ba8350fe4c0e94472bc92d87b1e7a7
blob + ac8dcf12515eb0f9798582bf478bbbcb1065c935
--- hosts/impish/overlays/config/volare/config
+++ hosts/impish/overlays/config/volare/config
@@ -24,7 +24,7 @@ input type:touchpad {
     tap disable
     drag disable
     click_method none
-    scroll_method none
+    scroll_method two_finger
 }
 
 input "pointer-1189-32769-BenQ_ZOWIE_BenQ_ZOWIE_Gaming_Mouse" {
blob - /dev/null
blob + 64d04594188b9d9368d0f691873b034d1f6b51a0 (mode 755)
--- /dev/null
+++ modules/mixins/dotfiles/bin/fzf-image-preview
@@ -0,0 +1,47 @@
+#!/bin/sh
+# Preview an image in fzf. Uses kitty icat inside kitty (including tmux
+# with passthrough) and falls back to chafa sixels elsewhere.
+# Usage:
+#   fzf-image-preview FILE
+#   ... | fzf-image-preview
+# Sizing comes from FZF_PREVIEW_COLUMNS and FZF_PREVIEW_LINES at preview time.
+
+dim="${FZF_PREVIEW_COLUMNS:-80}x${FZF_PREVIEW_LINES:-24}"
+
+pick_icat() {
+	if command -v kitten >/dev/null 2>&1
+	then
+		printf '%s\n' 'kitten icat'
+		return 0
+	fi
+	if command -v kitty >/dev/null 2>&1
+	then
+		printf '%s\n' 'kitty +kitten icat'
+		return 0
+	fi
+	return 1
+}
+
+in_kitty() {
+	[ -n "$KITTY_WINDOW_ID" ] || [ -n "$KITTY_PID" ] || [ -n "$KITTY_LISTEN_ON" ]
+}
+
+if in_kitty && icat=$(pick_icat)
+then
+	if [ -n "$1" ] && [ "$1" != "-" ]
+	then
+		# shellcheck disable=SC2086
+		$icat --clear --transfer-mode=memory --unicode-placeholder --stdin=no --place="$dim@0x0" "$1"
+	else
+		# shellcheck disable=SC2086
+		$icat --clear --transfer-mode=memory --unicode-placeholder --place="$dim@0x0"
+	fi
+	exit "$?"
+fi
+
+if [ -n "$1" ] && [ "$1" != "-" ]
+then
+	exec chafa --format=sixels --size="$dim" "$1"
+else
+	exec chafa --format=sixels --size="$dim" -
+fi
blob - a2cc70cbd7113148ebb7fc5f1217d2954fdd1df8
blob + 35057f900c15291c71fe9c88a29dc2b87b95dacc
--- modules/mixins/dotfiles/bin/recup
+++ modules/mixins/dotfiles/bin/recup
@@ -5,7 +5,7 @@ recdir=$(realpath "${1:-$HOME/misc/recordings}")
 mkdir -p "$recdir"
 
 RESULT=$(eza --oneline --reverse --sort=created "$recdir" | fzf --reverse --expect=ctrl-u \
-	--preview="ffmpeg -i $recdir/{} -vf 'select=eq(n\,0)' -frames:v 1 -f image2pipe -vcodec png - 2>/dev/null | chafa --format=sixels --size=\${FZF_PREVIEW_COLUMNS}x\${FZF_PREVIEW_LINES} - 2>/dev/null || stat $recdir/{}")
+	--preview="ffmpeg -i $recdir/{} -vf 'select=eq(n\,0)' -frames:v 1 -f image2pipe -vcodec png - 2>/dev/null | fzf-image-preview 2>/dev/null || stat $recdir/{}")
 KEY=$(printf '%s\n' "$RESULT" | sed -n '1p')
 PICKED=$(printf '%s\n' "$RESULT" | sed -n '2p')
 
blob - 6fe314bad650796e5444c742e72e331c9d491531
blob + 94d22bf694a99b09be2ebb867c3fb6790bdf751c
--- modules/mixins/dotfiles/bin/recup-keep-format
+++ modules/mixins/dotfiles/bin/recup-keep-format
@@ -5,7 +5,7 @@ recdir=$(realpath "${1:-$HOME/misc/recordings}")
 mkdir -p "$recdir"
 
 PICKED=$(eza --oneline --reverse --sort=created "$recdir" | fzf --reverse \
-	--preview="ffmpeg -i $recdir/{} -vf 'select=eq(n\,0)' -frames:v 1 -f image2pipe -vcodec png - 2>/dev/null | chafa --format=sixels --size=\${FZF_PREVIEW_COLUMNS}x\${FZF_PREVIEW_LINES} - 2>/dev/null || stat $recdir/{}")
+	--preview="ffmpeg -i $recdir/{} -vf 'select=eq(n\,0)' -frames:v 1 -f image2pipe -vcodec png - 2>/dev/null | fzf-image-preview 2>/dev/null || stat $recdir/{}")
 
 if [ -n "$PICKED" ]; then
 	aws s3 cp "$recdir/$PICKED" "s3://recordings/$PICKED"
blob - c2e622b43e52f313b71feed4db753e77b339d7d4
blob + 3a0b432495bc7d134aae7d5c719809ee9b977642
--- modules/mixins/dotfiles/bin/recup-tiny
+++ modules/mixins/dotfiles/bin/recup-tiny
@@ -5,7 +5,7 @@ recdir=$(realpath "${1:-$HOME/misc/recordings}")
 mkdir -p "$recdir"
 
 PICKED=$(eza --oneline --reverse --sort=created "$recdir" | fzf --reverse \
-	--preview="ffmpeg -i $recdir/{} -vf 'select=eq(n\,0)' -frames:v 1 -f image2pipe -vcodec png - 2>/dev/null | chafa --format=sixels --size=\${FZF_PREVIEW_COLUMNS}x\${FZF_PREVIEW_LINES} - 2>/dev/null || stat $recdir/{}")
+	--preview="ffmpeg -i $recdir/{} -vf 'select=eq(n\,0)' -frames:v 1 -f image2pipe -vcodec png - 2>/dev/null | fzf-image-preview 2>/dev/null || stat $recdir/{}")
 
 if [ -n "$PICKED" ]; then
 	ffmpeg -i "$recdir/$PICKED" -vf "scale=-2:720" -c:v libvpx-vp9 -deadline realtime -cpu-used 8 -crf 40 -b:v 0 -c:a libopus -b:a 64k -f webm - |
blob - 86b5bed8147c9a1ab6a9af169d484f5c6c0ff20d
blob + 4ef7c7e8256eac7a48b056a0a77f835b90564db4
--- modules/mixins/dotfiles/bin/scup
+++ modules/mixins/dotfiles/bin/scup
@@ -5,7 +5,7 @@ scdir=$(realpath "${1:-$HOME/misc/screenshots}")
 mkdir -p "$scdir"
 
 RESULT=$(eza --oneline --reverse --sort=created "$scdir" | fzf --reverse --expect=ctrl-u \
-	--preview="chafa --format=sixels --size=\${FZF_PREVIEW_COLUMNS}x\${FZF_PREVIEW_LINES} $scdir/{} 2>/dev/null || stat $scdir/{}")
+	--preview="fzf-image-preview $scdir/{} 2>/dev/null || stat $scdir/{}")
 KEY=$(printf '%s\n' "$RESULT" | sed -n '1p')
 PICKED=$(printf '%s\n' "$RESULT" | sed -n '2p')
 
blob - b985e1ced8b2168b85f28575309b3b9dc984660d
blob + dfd5f052545ae685b28f93ea05fe6c54a3bd6ff3
--- modules/mixins/dotfiles/config/shell/rc/aliased-short-names
+++ modules/mixins/dotfiles/config/shell/rc/aliased-short-names
@@ -16,8 +16,8 @@ alias tls='tmux list-sessions'
 alias tms="tmux display-message -p '#{session_name}'"
 
 alias mgr='magdalena grep'
-alias mrd='magdalena recent-dirs'
 alias mrf='magdalena recent-files'
+alias mrd='magdalena recent-directories'
 
 alias alt='aaltomuoto'
 alias vrt='virittaa'
blob - b1cc69692686a41df9b19a3512317d2de02929d3
blob + 38d3f0c9ee747b5ee8925b8922319cd8a3ee2784
--- modules/mixins/dotfiles/config/shell/rc/functions
+++ modules/mixins/dotfiles/config/shell/rc/functions
@@ -162,7 +162,7 @@ ae() {
 }
 
 cd() {
-	builtin cd "$@" && magdalena log-dir "$PWD"
+	builtin cd "$@" && magdalena log-directory "$PWD"
 }
 
 t() {
@@ -226,9 +226,9 @@ d() {
 		return
 	fi
 
-	target_dir=$(magdalena look-dir)
+	target_dir=$(magdalena look-directory)
 	if [ -n "$target_dir" ]; then
-		cd "$target_dir" && magdalena log-dir "$PWD"
+		cd "$target_dir" && magdalena log-directory "$PWD"
 	fi
 }
 
blob - 1d54f916bea15ef7247bbd5b7a62d1c5f152339e (mode 644)
blob + /dev/null
--- modules/mixins/dotfiles/config/zsh/completion/_backup
+++ /dev/null
@@ -1,70 +0,0 @@
-#compdef backup
-
-_backup() {
-  local curcontext="$curcontext" state state_descr line
-  local -a arguments targets stores sources
-
-  arguments=(
-    '(-p --push)'{-p,--push}'[fetch and push changes after commit]'
-    '(-f --fetch)'{-f,--fetch}'[pull Git targets before backup]'
-    '(-q --quiet)'{-q,--quiet}'[suppress command output]'
-    '(-l --list)'{-l,--list}'[list configured backup targets]'
-    '(-e --exclude)'{-e,--exclude}'[comma-separated sources or targets to skip]:sources'
-    '(-h --help)'{-h,--help}'[show help]'
-    '1:backup target:->target'
-  )
-
-  _arguments -S -s $arguments && return
-
-  case $state in
-    target)
-      case $words[CURRENT] in
-        *:*)
-          local backend=${words[CURRENT]%%:*}
-          local remainder=${words[CURRENT]#*:}
-          case $backend in
-            git)
-              compadd -P 'git:' -S '' - \
-                bandcamp mpd nix notes pass releases
-              ;;
-            tarsnap)
-              compadd -P 'tarsnap:' -S '' - \
-                mpd notes password-store releases
-              ;;
-            plakar)
-              if [[ $remainder == *:* ]]; then
-                local store=${remainder%%:*}
-                local source_spec=${remainder#*:}
-                local completed_sources prefix source existing
-                local -a remaining selected
-                sources=("${(@f)$(backup --list 2>/dev/null | awk '/^plakar$/{p=1; next} /^rclone$/{p=0} p && /^    /{print $1}')}")
-                if [[ $source_spec == *,* ]]; then
-                  completed_sources=${source_spec%,*}
-                  selected=("${(@s:,:)completed_sources}")
-                  prefix="plakar:${store}:${completed_sources},"
-                  for source in $sources; do
-                    (( ${selected[(Ie)$source]} )) || remaining+=($source)
-                  done
-                  sources=($remaining)
-                else
-                  prefix="plakar:${store}:"
-                fi
-                compadd -P "$prefix" -S ',' - $sources
-              else
-                stores=("${(@f)$(backup --list 2>/dev/null | awk '/^plakar$/{p=1; next} /^rclone$/{p=0} p && /^  [^ ]/ && $1 != "sources"{print $1}')}")
-                compadd -P 'plakar:' -S ':' - $stores
-              fi
-              ;;
-            rclone)
-              sources=("${(@f)$(backup --list 2>/dev/null | awk '/^rclone$/{p=1; next} p && /^    /{print $1}')}")
-              compadd -P 'rclone:' -S '' - $sources
-              ;;
-          esac
-          ;;
-        *)
-          compadd -S ':' - git plakar tarsnap rclone
-          ;;
-      esac
-      ;;
-  esac
-}
blob - /dev/null
blob + fb481b267fa7a52d369704770ef9298223a52176 (mode 644)
--- /dev/null
+++ modules/mixins/dotfiles/config/zsh/completion/_sursum
@@ -0,0 +1,72 @@
+#compdef sursum
+
+_sursum() {
+  local curcontext="$curcontext" state state_descr line
+  local -a arguments targets stores sources
+
+  arguments=(
+    '(-p --push)'{-p,--push}'[fetch and push changes after commit]'
+    '(-f --fetch)'{-f,--fetch}'[pull Git targets before backup]'
+    '(-q --quiet)'{-q,--quiet}'[suppress command output]'
+    '(-l --list)'{-l,--list}'[list configured backup targets]'
+    '(-e --exclude)'{-e,--exclude}'[comma-separated sources or targets to skip]:sources'
+    '(-h --help)'{-h,--help}'[show help]'
+    '1:backup target:->target'
+  )
+
+  _arguments -S -s $arguments && return
+
+  case $state in
+    target)
+      case $words[CURRENT] in
+        *:*)
+          local backend=${words[CURRENT]%%:*}
+          local remainder=${words[CURRENT]#*:}
+          case $backend in
+            git)
+              compadd -P 'git:' -S '' - \
+                bandcamp mpd nix notes pass releases
+              ;;
+            tarsnap)
+              compadd -P 'tarsnap:' -S '' - \
+                mpd notes password-store releases
+              ;;
+            plakar)
+              if [[ $remainder == *:* ]]; then
+                local store=${remainder%%:*}
+                local source_spec=${remainder#*:}
+                local completed_sources prefix source existing
+                local -a remaining selected
+                sources=("${(@f)$(sursum --list 2>/dev/null | awk '/^plakar$/{p=1; next} /^rclone$/{p=0} p && /^    /{print $1}')}")
+                if [[ $source_spec == *,* ]]; then
+                  completed_sources=${source_spec%,*}
+                  selected=("${(@s:,:)completed_sources}")
+                  prefix="plakar:${store}:${completed_sources},"
+                  for source in $sources; do
+                    (( ${selected[(Ie)$source]} )) || remaining+=($source)
+                  done
+                  sources=($remaining)
+                else
+                  prefix="plakar:${store}:"
+                fi
+                compadd -P "$prefix" -S ',' - $sources
+              else
+                stores=("${(@f)$(sursum --list 2>/dev/null | awk '/^plakar$/{p=1; next} /^rclone$/{p=0} p && /^  [^ ]/ && $1 != "sources"{print $1}')}")
+                compadd -P 'plakar:' -S ':' - $stores
+              fi
+              ;;
+            rclone)
+              sources=("${(@f)$(sursum --list 2>/dev/null | awk '/^rclone$/{p=1; next} p && /^    /{print $1}')}")
+              compadd -P 'rclone:' -S '' - $sources
+              ;;
+          esac
+          ;;
+        *)
+          compadd -S ':' - git plakar tarsnap rclone
+          ;;
+      esac
+      ;;
+  esac
+}
+
+_sursum "$@"
blob - 36e3f93ba43882d94af548253dec6051dca9a113
blob + 850f75a5d0fb08ecc6d6abf20d566eb61600f29a
--- modules/mixins/dotfiles/config/zsh/rc/keybindings
+++ modules/mixins/dotfiles/config/zsh/rc/keybindings
@@ -55,5 +55,5 @@ zle -N fzf_copy_from_cliphist
 
 bindkey '^J' 'fzf_copy_from_cliphist'
 bindkey '^F' 'magdalena_goto_file'
-bindkey '^K' 'magdalena_goto_dir'
+bindkey '^K' 'magdalena_goto_directory'
 bindkey '^G' 'magdalena_favorites'
blob - ff8afafb4bdb36feae6c16650012d2c49dd45158
blob + 78d833dbc6855b31969e077a5576225e4de6c2db
--- modules/mixins/dotfiles/config/zsh/rc/magdalena
+++ modules/mixins/dotfiles/config/zsh/rc/magdalena
@@ -1,18 +1,18 @@
 #!/bin/zsh
 
+magdalena_goto_directory() {
+	dir=$(magdalena goto-directory) && cd "$dir" && zle reset-prompt 2>/dev/null || true
+}
+
 magdalena_goto_file() {
 	magdalena goto-file "$@" && zle reset-prompt 2>/dev/null || true
 }
 
-magdalena_goto_dir() {
-	dir=$(magdalena goto-dir) && cd "$dir" && zle reset-prompt 2>/dev/null || true
-}
-
 magdalena_favorites() {
 	local result=$(magdalena favorites) && cd "$result"
 	zle reset-prompt 2>/dev/null || true
 }
 
+zle -N magdalena_goto_directory
 zle -N magdalena_goto_file
-zle -N magdalena_goto_dir
 zle -N magdalena_favorites