diff --git a/hosts/pinwheel/modules/sound/default.nix b/hosts/pinwheel/modules/sound/default.nix index 5519e06..c9c8917 100644 --- a/hosts/pinwheel/modules/sound/default.nix +++ b/hosts/pinwheel/modules/sound/default.nix @@ -32,41 +32,15 @@ in MUTED=$(${pkgs.wireplumber}/bin/wpctl get-volume @DEFAULT_AUDIO_SOURCE@ | grep MUTED | wc -l) echo $MUTED > /sys/class/leds/platform::micmute/brightness ''; - - prev = "${pkgs.playerctl}/bin/playerctl -p playerctld previous"; - next = "${pkgs.playerctl}/bin/playerctl -p playerctld next"; in [ ", XF86AudioRaiseVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 2%+" ", XF86AudioLowerVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-" ", XF86AudioMute, exec, ${toggle-output-mute}" ", XF86AudioMicMute, exec, ${toggle-input-mute}" - - ", XF86AudioPrev, exec, ${prev}" - ", XF86AudioNext, exec, ${next}" - ", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl -p playerctld play" - ", XF86AudioPause, exec, ${pkgs.playerctl}/bin/playerctl -p playerctld pause" - - "$mod ALT, LEFT, exec, ${prev}" - "$mod ALT, RIGHT, exec, ${next}" - "$mod ALT, DOWN, exec, ${pkgs.playerctl}/bin/playerctl -p playerctld play-pause" ]; }; }; - home.packages = [ - pkgs.pavucontrol - pkgs.playerctl - ]; - }; - - systemd.user.services.playerctld = { - unitConfig = { - Description = "starts playerctld daemon"; - }; - - wantedBy = [ "default.target" ]; - serviceConfig = { - ExecStart = "${pkgs.playerctl}/bin/playerctld"; - }; + home.packages = [ pkgs.pavucontrol ]; }; } diff --git a/hosts/pinwheel/modules/spotify/default.nix b/hosts/pinwheel/modules/spotify/default.nix index cc0dfca..7e33d11 100644 --- a/hosts/pinwheel/modules/spotify/default.nix +++ b/hosts/pinwheel/modules/spotify/default.nix @@ -1,6 +1,41 @@ -{ pkgs, ... }: +{ pkgs, lib, config, ... }: +let + hyprlandEnabled = config.mod.hyprland.enable; +in { home-manager.users.alex = { - home.packages = [ pkgs.spotify ]; + wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled { + settings = { + bind = let + prev = "${pkgs.playerctl}/bin/playerctl -p spotify previous"; + next = "${pkgs.playerctl}/bin/playerctl -p spotify next"; + in [ + ", XF86AudioPrev, exec, ${prev}" + ", XF86AudioNext, exec, ${next}" + ", XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl -p spotify play-pause" + ", XF86AudioPause, exec, ${pkgs.playerctl}/bin/playerctl -p spoitfy play-pause" + + "$mod ALT, LEFT, exec, ${prev}" + "$mod ALT, RIGHT, exec, ${next}" + "$mod ALT, DOWN, exec, ${pkgs.playerctl}/bin/playerctl -p spotify play-pause" + ]; + }; + }; + + home.packages = [ + pkgs.playerctl + pkgs.spotify + ]; + }; + + systemd.user.services.playerctld = { + unitConfig = { + Description = "starts playerctld daemon"; + }; + + wantedBy = [ "default.target" ]; + serviceConfig = { + ExecStart = "${pkgs.playerctl}/bin/playerctld"; + }; }; }