From e3c89f1c377a912a459e76153a26130ff3f6f9b3 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Tue, 22 Apr 2025 13:45:12 -0400 Subject: [PATCH] AutoYADM commit: 2025-04-22 13:45:12 --- .config/helix/scripts/typst-zathura.fish | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.config/helix/scripts/typst-zathura.fish b/.config/helix/scripts/typst-zathura.fish index 46b3db68..ff15c081 100755 --- a/.config/helix/scripts/typst-zathura.fish +++ b/.config/helix/scripts/typst-zathura.fish @@ -4,7 +4,7 @@ set -l src (path resolve $argv[1]) # echo $src # string replace set -l targ (string replace --filter '.typ' '.pdf' $src) -if test -f "$targ" +if test -f "$targ" -a '' != '' zathura "$targ" &>/dev/null & else # no such file in current dir, time to search! @@ -12,7 +12,13 @@ else # if we're not, search from cwd if git rev-parse --is-inside-work-tree &>/dev/null echo in git + set -l root (git rev-parse --show-toplevel) + echo $root + set -l base (path basename --no-extension) + set -l base $base.pdf + echo $base else echo out git + set -l root (pwd) end end