diff --git a/.config/helix/scripts/typst-zathura.fish b/.config/helix/scripts/typst-zathura.fish index 1e9fd186..b8e2299a 100755 --- a/.config/helix/scripts/typst-zathura.fish +++ b/.config/helix/scripts/typst-zathura.fish @@ -41,9 +41,16 @@ if test -z "$parent_pid" end echo $parent_pid +# opens zathura, watching for helix closing function zopen --wraps zathura - zathura "$argv[1]" &>/dev/null & - set zathura_pid $last_pid + begin + zathura "$argv[1]" &>/dev/null & + set zathura_pid $last_pid + notify-send "$zathura_pid" + inotifywait -qq -e delete_self /proc/$parent_pid + notify-send "Zathura killed" + kill $zathura_pid + end & end function find_pdf