AutoYADM commit: 2025-04-22 14:15:12
This commit is contained in:
parent
f36cf2e410
commit
0a37f956b8
1 changed files with 6 additions and 3 deletions
|
@ -1,9 +1,12 @@
|
||||||
#!/usr/bin/env fish
|
#!/usr/bin/env fish
|
||||||
|
set parent_pid (ps -o ppid= -p $fish_pid | string trim)
|
||||||
|
echo $parent_pid
|
||||||
|
|
||||||
argparse q/quiet -- $argv
|
argparse q/quiet -- $argv
|
||||||
|
|
||||||
function z --wraps zathura
|
function zopen --wraps zathura
|
||||||
zathura "$argv[1]" &>/dev/null &
|
zathura "$argv[1]" &>/dev/null &
|
||||||
|
set zathura_pid $last_pid
|
||||||
end
|
end
|
||||||
|
|
||||||
function find_pdf
|
function find_pdf
|
||||||
|
@ -11,7 +14,7 @@ function find_pdf
|
||||||
set -l base $argv[2]
|
set -l base $argv[2]
|
||||||
set -l candidate (fd --no-ignore-vcs -F -1 "$base" "$root")
|
set -l candidate (fd --no-ignore-vcs -F -1 "$base" "$root")
|
||||||
if test "$candidate" != ''
|
if test "$candidate" != ''
|
||||||
z "$candidate"
|
zopen "$candidate"
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
@ -42,7 +45,7 @@ set -l targ (string replace '.typ' '.pdf' $src)
|
||||||
set -l base (path basename --no-extension $src).pdf
|
set -l base (path basename --no-extension $src).pdf
|
||||||
if test -f "$targ" -a '' != ''
|
if test -f "$targ" -a '' != ''
|
||||||
# zathura "$targ" &>/dev/null &
|
# zathura "$targ" &>/dev/null &
|
||||||
z "$targ"
|
zopen "$targ"
|
||||||
else
|
else
|
||||||
# no such file in current dir, time to search!
|
# no such file in current dir, time to search!
|
||||||
# if we're in a git repo, search from root
|
# if we're in a git repo, search from root
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue