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%-"
|
", XF86AudioLowerVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-"
|
||||||
", XF86AudioMute, exec, ${toggle-output-mute}"
|
", XF86AudioMute, exec, ${toggle-output-mute}"
|
||||||
", XF86AudioMicMute, exec, ${toggle-input-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, ... }:
|
{ pkgs, ... }:
|
||||||
let
|
|
||||||
hyprlandEnabled = config.mod.hyprland.enable;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
home-manager.users.alex = {
|
home-manager.users.alex = {
|
||||||
home.packages = with pkgs; [
|
home.packages = [ pkgs.spotify ];
|
||||||
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"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user