diff --git a/.config/fish/functions/pdf.fish b/.config/fish/functions/pdf.fish new file mode 100644 index 00000000..19937c0a --- /dev/null +++ b/.config/fish/functions/pdf.fish @@ -0,0 +1,3 @@ +function pdf --wraps=zathura + command zathura $argv &>/dev/null & disown +end diff --git a/.config/helix/scripts/hx-typ-zathura.fish b/.config/helix/scripts/hx-typ-zathura.fish index 7d6fabe9..5a71441f 100755 --- a/.config/helix/scripts/hx-typ-zathura.fish +++ b/.config/helix/scripts/hx-typ-zathura.fish @@ -120,12 +120,9 @@ if not string match -q '*.typ' $src return $ret end # change abs path to pdf extension -set -l targ (string replace '.typ' '.pdf' $src) -echo $targ +set -l targ (string replace --regex '\.typ$' '.pdf' $src) # get pdf target's base name set -l base (path basename --no-extension $src).pdf -echo $base -return 0 # if a suitable pdf exists in the same dir, open it if test -f "$targ"