nixos/home/modules/playerctl.nix

43 lines
916 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 {
services.playerctld.enable = true;
home.packages = with pkgs; [
playerctl
];
2024-07-12 06:43:08 +00:00
systemd.user.services.sxhkd = {
Unit = {
Description = "sxhkd service";
PartOf = [ "graphical-session.target" ];
};
Service = {
Type = "exec";
ExecStart = "${pkgs.sxhkd}/bin/sxhkd";
};
Install = {
WantedBy = [ "graphical-session.target" ];
};
};
services.sxhkd = {
2024-07-12 06:43:08 +00:00
enable = true;
keybindings = {
2024-07-12 06:43:08 +00:00
"XF86AudioPlay" = "${pkgs.playerctl}/bin/playerctl play-pause";
"XF86AudioPrev" = "${pkgs.playerctl}/bin/playerctl previous";
"XF86AudioNext" = "${pkgs.playerctl}/bin/playerctl next";
};
};
};
}