2018-09-05 18:27:01 -04:00
|
|
|
#!/bin/zsh
|
|
|
|
MAC_KITTY=/Applications/kitty.app/Contents/MacOS
|
|
|
|
|
|
|
|
if (( $+commands[kitty] == 0 )); then
|
|
|
|
if [[ -x $MAC_KITTY/kitty ]]; then
|
|
|
|
path=($MAC_KITTY $path)
|
|
|
|
else
|
2018-10-11 00:39:52 -04:00
|
|
|
print "Sorry, kitty must be installed to use this script! https://sw.kovidgoyal.net/kitty" >&2
|
2018-09-05 18:27:01 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
2024-07-08 20:40:38 -04:00
|
|
|
|
|
|
|
# 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] "$@"
|