pinwheel: Rebind media player keys to control last active player
By leveraging `playerctld` that is aware of the last used player
This commit is contained in:
@@ -39,10 +39,28 @@ in
|
||||
", XF86AudioLowerVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-"
|
||||
", XF86AudioMute, exec, ${toggle-output-mute}"
|
||||
", XF86AudioMicMute, exec, ${toggle-input-mute}"
|
||||
|
||||
"$mod ALT, LEFT, exec, ${pkgs.playerctl}/bin/playerctl -p playerctld previous"
|
||||
"$mod ALT, RIGHT, exec, ${pkgs.playerctl}/bin/playerctl -p playerctld next"
|
||||
"$mod ALT, DOWN, exec, ${pkgs.playerctl}/bin/playerctl -p playerctld play-pause"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = [ pkgs.pavucontrol ];
|
||||
home.packages = [
|
||||
pkgs.pavucontrol
|
||||
pkgs.playerctl
|
||||
];
|
||||
};
|
||||
|
||||
systemd.user.services.playerctld = {
|
||||
unitConfig = {
|
||||
Description = "starts playerctld daemon";
|
||||
};
|
||||
|
||||
wantedBy = [ "default.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.playerctl}/bin/playerctld";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,22 +1,6 @@
|
||||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
hyprlandEnabled = config.mod.hyprland.enable;
|
||||
in
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home-manager.users.alex = {
|
||||
home.packages = with pkgs; [
|
||||
spotify
|
||||
playerctl
|
||||
];
|
||||
|
||||
wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled {
|
||||
settings = {
|
||||
bind = [
|
||||
"$mod ALT, LEFT, exec, ${pkgs.playerctl}/bin/playerctl -p spotify previous"
|
||||
"$mod ALT, RIGHT, exec, ${pkgs.playerctl}/bin/playerctl -p spotify next"
|
||||
"$mod ALT, DOWN, exec, ${pkgs.playerctl}/bin/playerctl -p spotify play-pause"
|
||||
];
|
||||
};
|
||||
};
|
||||
home.packages = [ pkgs.spotify ];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user