playerctl: manual config generation
parent
5f311c05f3
commit
c5ae0732e4
|
@ -2,6 +2,15 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.snowhawk.playerctl;
|
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
|
in
|
||||||
{
|
{
|
||||||
options.snowhawk.playerctl = {
|
options.snowhawk.playerctl = {
|
||||||
|
@ -30,12 +39,13 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
xdg.configFile."sxhkd/sxhkdrc".text = keybindingsStr;
|
||||||
|
|
||||||
services.sxhkd =
|
services.sxhkd =
|
||||||
let
|
let
|
||||||
playerctlcmd = "${pkgs.playerctl}/bin/playerctl";
|
playerctlcmd = "${pkgs.playerctl}/bin/playerctl";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
enable = true;
|
|
||||||
keybindings = {
|
keybindings = {
|
||||||
"XF86AudioPlay" = "${playerctlcmd} play-pause";
|
"XF86AudioPlay" = "${playerctlcmd} play-pause";
|
||||||
"XF86AudioPrev" = "${playerctlcmd} previous";
|
"XF86AudioPrev" = "${playerctlcmd} previous";
|
||||||
|
|
Loading…
Reference in New Issue