From 58b4cd98159dcff1c6442972977c480b4bf2aabf Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Fri, 12 Jul 2024 00:03:48 -0700 Subject: [PATCH] cleanup: extracting a command for funsies :P --- home/modules/playerctl.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/home/modules/playerctl.nix b/home/modules/playerctl.nix index 50dbdb7..8e6f6ce 100644 --- a/home/modules/playerctl.nix +++ b/home/modules/playerctl.nix @@ -30,13 +30,17 @@ in }; }; - services.sxhkd = { - enable = true; - keybindings = { - "XF86AudioPlay" = "${pkgs.playerctl}/bin/playerctl play-pause"; - "XF86AudioPrev" = "${pkgs.playerctl}/bin/playerctl previous"; - "XF86AudioNext" = "${pkgs.playerctl}/bin/playerctl next"; + services.sxhkd = + let + playerctlcmd = "${pkgs.playerctl}/bin/playerctl"; + in + { + enable = true; + keybindings = { + "XF86AudioPlay" = "${playerctlcmd} play-pause"; + "XF86AudioPrev" = "${playerctlcmd} previous"; + "XF86AudioNext" = "${playerctlcmd} next"; + }; }; - }; }; }