mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
style: make shell scripts follow shfmt
This commit is contained in:
parent
2a4740b6c9
commit
437bc79968
11 changed files with 167 additions and 139 deletions
28
scripts/swarselcheck.sh
Executable file → Normal file
28
scripts/swarselcheck.sh
Executable file → Normal 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue