diff options
Diffstat (limited to 'togglespot.sh')
| -rwxr-xr-x | togglespot.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/togglespot.sh b/togglespot.sh new file mode 100755 index 0000000..c713de5 --- /dev/null +++ b/togglespot.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +workspace=$(hyprctl clients -j | jq -r '.[] | select(.class == "Spotify") | .workspace.name') + +if [ -z $workspace ]; then + hyprctl dispatch exec [workspace +0, noinitialfocus] LD_PRELOAD=/usr/lib/spotify-adblock.so spotify + workspace=7 +fi + + +if [ $workspace -eq 7 ]; then + hyprctl --batch 'dispatch setfloating class:Spotify; dispatch movetoworkspace +0, class:Spotify' +else + hyprctl --batch 'dispatch settiled class:Spotify; dispatch movetoworkspacesilent 7, class:Spotify' +fi |
