style: make shell scripts follow shfmt

This commit is contained in:
Swarsel 2024-12-10 18:19:28 +01:00
parent 2a4740b6c9
commit 437bc79968
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
11 changed files with 167 additions and 139 deletions

28
scripts/swarselcheck.sh Executable file → Normal file
View file

@ -4,15 +4,19 @@ vesktop=0
spotifyplayer=0
while :; do
case ${1:-} in
-k|--kitty) kitty=1
;;
-e|--element) element=1
;;
-d|--vesktop) vesktop=1
;;
-s|--spotifyplayer) spotifyplayer=1
;;
*) break
-k | --kitty)
kitty=1
;;
-e | --element)
element=1
;;
-d | --vesktop)
vesktop=1
;;
-s | --spotifyplayer)
spotifyplayer=1
;;
*) break ;;
esac
shift
done
@ -21,7 +25,8 @@ if [[ $kitty -eq 1 ]]; then
STR=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]) | select(.name == "__i3_scratch")' | grep kittyterm || true)
CHECK=$(swaymsg -t get_tree | grep kittyterm || true)
if [ "$CHECK" == "" ]; then
exec kitty -T kittyterm & sleep 1
exec kitty -T kittyterm &
sleep 1
fi
if [ "$STR" == "" ]; then
exec swaymsg '[title="kittyterm"]' scratchpad show
@ -46,7 +51,8 @@ elif [[ $spotifyplayer -eq 1 ]]; then
STR=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]) | select(.name == "__i3_scratch")' | grep spotifytui || true)
CHECK=$(swaymsg -t get_tree | grep spotifytui || true)
if [ "$CHECK" == "" ]; then
exec kitty -T spotifytui -o confirm_os_window_close=0 spotify_player & sleep 1
exec kitty -T spotifytui -o confirm_os_window_close=0 spotify_player &
sleep 1
fi
if [ "$STR" == "" ]; then
exec swaymsg '[title="spotifytui"]' scratchpad show