Use default Kitty socket path rather than XDG_CACHE_HOME
This commit is contained in:
parent
7b7b6624a5
commit
ce52cd1c69
1 changed files with 9 additions and 2 deletions
|
@ -1,5 +1,4 @@
|
|||
#!/bin/zsh
|
||||
: ${XDG_CACHE_HOME:=~/.cache}
|
||||
MAC_KITTY=/Applications/kitty.app/Contents/MacOS
|
||||
|
||||
if (( $+commands[kitty] == 0 )); then
|
||||
|
@ -10,4 +9,12 @@ if (( $+commands[kitty] == 0 )); then
|
|||
exit 1
|
||||
fi
|
||||
fi
|
||||
exec kitty @ --to unix:$XDG_CACHE_HOME/kitty/kitty.sock "$@"
|
||||
|
||||
# Sort the sockets youngest-first, because the youngest one is most likely to be still alive.
|
||||
sockets=( ${TMPDIR}/kitty-socket-*(om) )
|
||||
if (( $#sockets < 1 )); then
|
||||
print "Sorry, no Kitty socket could be found. Check $TMPDIR for 'kitty-socket' files." >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
exec kitty @ --to unix:$sockets[1] "$@"
|
||||
|
|
Loading…
Reference in a new issue