From f266ccaa4afd3843cfe30da3d2018ecc928e3738 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sat, 28 Dec 2024 18:58:56 +0800 Subject: init: toggle spot --- togglespot.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 togglespot.sh (limited to 'togglespot.sh') 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 -- cgit v1.2.3