hyprland: park spotify-player on special:music, toggle with SUPER+M

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-08-16 13:19:43 +01:00
parent dd7ba284f7
commit 9514664a55
2 changed files with 28 additions and 1 deletions

View file

@ -215,10 +215,19 @@ in
};
# Upstream ships no .desktop file (TUI only), so the launcher can't find it.
# Hyprland parks the instance started at login on the special:music workspace
# (see settings/hyprland.nix), so this toggles that window rather than opening
# a second terminal — a fresh process would mean another ~20s wait for its
# Spotify Connect device. Relaunch first if the window is gone, otherwise the
# toggle just reveals an empty workspace.
xdg.desktopEntries.spotify-player = lib.mkIf isDesktop {
name = "Spotify Player";
genericName = "Music Player";
exec = "ghostty --title=spotify-player -e spotify_player";
exec = "${pkgs.writeShellScript "spotify-player-toggle" ''
hyprctl clients | grep -q "title: spotify-player" \
|| ghostty --title=spotify-player -e spotify_player
hyprctl dispatch togglespecialworkspace music
''}";
icon = "spotify";
terminal = false;
categories = [ "Audio" "Music" "Player" "AudioVideo" ];