hypr: add Spotify workspace integration

- Add on-created-empty auto-launch for spotify and passwordmgr workspaces
- Add hypr-spotify-toggle script (mirrors steam/joplin/mail pattern)
- Add Super+A,C quickws keybind for spotify toggle

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-13 02:01:12 +01:00
parent 399596b88e
commit d17080f62b
3 changed files with 65 additions and 38 deletions

View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail
spotify_ws="name:spotify"
spotify_name="spotify"
active_name=""
if json="$(hyprctl -j activeworkspace 2>/dev/null)"; then
if command -v jq >/dev/null 2>&1; then
active_name="$(printf '%s' "$json" | jq -r '.name // empty')"
else
active_name="$(printf '%s' "$json" | sed -n 's/.*"name":"\\([^"]*\\)".*/\\1/p')"
fi
fi
if [[ -z "$active_name" ]]; then
active_name="$(hyprctl activeworkspace 2>/dev/null | sed -n 's/.*(\\(.*\\)).*/\\1/p' | head -n1)"
fi
if [[ "$active_name" == "$spotify_name" || "$active_name" == "$spotify_ws" ]]; then
hyprctl dispatch workspace previous
else
hyprctl dispatch moveworkspacetomonitor "$spotify_ws" current
hyprctl dispatch workspace "$spotify_ws"
fi