nixos/home/modules/playerctl.nix

33 lines
785 B
Nix
Raw Normal View History

{ lib, config, pkgs, ... }:
let
cfg = config.snowhawk.playerctl;
in
{
options.snowhawk.playerctl = {
enable = lib.mkEnableOption "playerctl";
};
config = lib.mkIf cfg.enable {
2024-07-16 10:32:01 +00:00
services.playerctld.enable = true;
2024-07-16 10:28:53 +00:00
systemd.user.services.playerctld = {
2024-07-16 10:32:01 +00:00
Unit.PartOf = lib.mkForce [ "graphical-session.target" ];
Install.WantedBy = lib.mkForce [ "graphical-session.target" ];
2024-07-16 10:28:53 +00:00
};
home.packages = with pkgs; [
playerctl
];
2024-09-28 05:21:40 +00:00
snowhawk.sxhkd.enable = lib.mkDefault true;
2024-07-13 00:15:01 +00:00
2024-09-28 05:21:40 +00:00
services.sxhkd.keybindings =
let playerctl = "${pkgs.playerctl}/bin/playerctl";
in {
"XF86AudioPlay" = "${playerctl} play-pause";
"XF86AudioPrev" = "${playerctl} previous";
"XF86AudioNext" = "${playerctl} next";
};
};
}