.dotfiles/scripts/editor_nowait.sh
2023-12-11 02:57:34 +01:00

16 lines
376 B
Bash
Executable file

#!/bin/bash
STR=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]) | select(.name == "__i3_scratch")' | grep kittyterm)
if [ "$STR" == "" ]; then
VAR="1"
swaymsg '[title="kittyterm"]' scratchpad show
emacsclient -c -a "" "$@"
else
VAR="0"
emacsclient -n -c -a "" "$@"
fi
if [ "$VAR" == "1" ]
then
swaymsg '[title="kittyterm"]' scratchpad show
fi
exit 0