diff --git a/home/modules/playerctl.nix b/home/modules/playerctl.nix index 8e6f6ce..b4537ae 100644 --- a/home/modules/playerctl.nix +++ b/home/modules/playerctl.nix @@ -2,6 +2,15 @@ let cfg = config.snowhawk.playerctl; + sxhkdCfg = config.services.sxhkd; + + keybindingsStr = lib.concatStringsSep "\n" (lib.mapAttrsToList + (hotkey: command: + lib.optionalString (command != null) '' + ${hotkey} + ${command} + '') + sxhkdCfg.keybindings); in { options.snowhawk.playerctl = { @@ -30,12 +39,13 @@ in }; }; + xdg.configFile."sxhkd/sxhkdrc".text = keybindingsStr; + services.sxhkd = let playerctlcmd = "${pkgs.playerctl}/bin/playerctl"; in { - enable = true; keybindings = { "XF86AudioPlay" = "${playerctlcmd} play-pause"; "XF86AudioPrev" = "${playerctlcmd} previous";