commit 456a9eee559d556120fce5fd6d8666617943faed parent 21ab07a1f5048bd9e88fd50614a34ad2a31c2a6e Author: mtmn <miro@haravara.org> Date: Tue, 12 May 2026 13:24:27 +0200 fix: show absolute path in `wrd`, etc. Diffstat:
| M | hosts/work/overlays/config/ghostty/config | | | 0 | |
| M | hosts/work/overlays/config/magdalena/config.json.nix | | | 0 | |
| M | hosts/work/overlays/config/shell/overrides | | | 0 | |
| M | modules/mixins/dotfiles/bin/wrd | | | 25 | +++++++++++++++++-------- |
4 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/hosts/work/overlays/config/ghostty/config b/hosts/work/overlays/config/ghostty/config Binary files differ. diff --git a/hosts/work/overlays/config/magdalena/config.json.nix b/hosts/work/overlays/config/magdalena/config.json.nix Binary files differ. diff --git a/hosts/work/overlays/config/shell/overrides b/hosts/work/overlays/config/shell/overrides Binary files differ. diff --git a/modules/mixins/dotfiles/bin/wrd b/modules/mixins/dotfiles/bin/wrd @@ -2,22 +2,31 @@ tmp=$(mktemp) trap 'rm -f "$tmp"' EXIT INT TERM +base="$HOME/misc/www" + while true; do - picked=$(fd -e html -e md . "$HOME/misc/www" --exec stat -c '%Y %n' | sort -rn | cut -d' ' -f2- | fzf --reverse --delimiter=/ --with-nth=-1 \ - --preview='case {} in - *.html) offpunk --dump {} 2>/dev/null || bat {};; - *.md) lowdown -Tterm {} 2>/dev/null || bat {};; + picked=$(fd -e html -e md . "$base" --exec stat -c '%Y %n' | sort -rn | cut -d' ' -f2- | + while IFS= read -r path; do + rel="${path#"$base"/}" + rel="${rel%/index.html}" + printf '%s\t%s\n' "$rel" "$path" + done | + fzf --reverse --with-nth=1 \ + --preview='case {2} in + *.html) offpunk --dump {2} 2>/dev/null || bat {2};; + *.md) lowdown -Tterm {2} 2>/dev/null || bat {2};; esac') [ -z "$picked" ] && break - case "$picked" in - *.html) offpunk "$picked" ;; + full=$(printf '%s' "$picked" | cut -f2) + case "$full" in + *.html) offpunk "$full" ;; *.md) - lowdown -Tterm "$picked" | + lowdown -Tterm "$full" | awk -v w="$(tput cols)" 'BEGIN{p=sprintf("%*s",w>80?(w-80)/2:0,"")} {print p $0}' \ >"$tmp" - tmux display-popup -E -w 100% -h 100% "moor -no-linenumbers -no-statusbar '$tmp'" + tmux display-popup -E -w 100% -h 100% "moor -no-linenumbers -no-statusbar $tmp" ;; esac done