summaryrefslogtreecommitdiff
path: root/togglespot.sh
blob: c713de513ad25f5544c080436bfd4c80a0bb0816 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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