From a5da6f001d3fe1844be95d6366602b29aa5770a2 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Tue, 22 Apr 2025 14:25:12 -0400 Subject: [PATCH] AutoYADM commit: 2025-04-22 14:25:12 --- .config/helix/scripts/typst-zathura.fish | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.config/helix/scripts/typst-zathura.fish b/.config/helix/scripts/typst-zathura.fish index e9a6d9f8..1e9fd186 100755 --- a/.config/helix/scripts/typst-zathura.fish +++ b/.config/helix/scripts/typst-zathura.fish @@ -8,6 +8,13 @@ else set ret 0 end +# only echo if -q not set +function qecho + if not set -q _flag_q + echo $argv[1] + end +end + # traverse up process tree to find caller Helix PID function find_parent_process -a target set current_pid $fish_pid @@ -28,6 +35,11 @@ function find_parent_process -a target end set parent_pid (find_parent_process hx) +if test -z "$parent_pid" + qecho "Couldn't find parent hx process!" + return $ret +end +echo $parent_pid function zopen --wraps zathura zathura "$argv[1]" &>/dev/null & @@ -45,13 +57,6 @@ function find_pdf end end -# only echo if -q not set -function qecho - if not set -q _flag_q - echo $argv[1] - end -end - set -l src (path resolve $argv[1]) # echo $src # string replace