From 0a37f956b8a06cc4c685be5ebff57218c866f526 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Tue, 22 Apr 2025 14:15:13 -0400 Subject: [PATCH] AutoYADM commit: 2025-04-22 14:15:12 --- .config/helix/scripts/typst-zathura.fish | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.config/helix/scripts/typst-zathura.fish b/.config/helix/scripts/typst-zathura.fish index 7beaffbc..edb3087e 100755 --- a/.config/helix/scripts/typst-zathura.fish +++ b/.config/helix/scripts/typst-zathura.fish @@ -1,9 +1,12 @@ #!/usr/bin/env fish +set parent_pid (ps -o ppid= -p $fish_pid | string trim) +echo $parent_pid argparse q/quiet -- $argv -function z --wraps zathura +function zopen --wraps zathura zathura "$argv[1]" &>/dev/null & + set zathura_pid $last_pid end function find_pdf @@ -11,7 +14,7 @@ function find_pdf set -l base $argv[2] set -l candidate (fd --no-ignore-vcs -F -1 "$base" "$root") if test "$candidate" != '' - z "$candidate" + zopen "$candidate" else return 1 end @@ -42,7 +45,7 @@ set -l targ (string replace '.typ' '.pdf' $src) set -l base (path basename --no-extension $src).pdf if test -f "$targ" -a '' != '' # zathura "$targ" &>/dev/null & - z "$targ" + zopen "$targ" else # no such file in current dir, time to search! # if we're in a git repo, search from root