From 9fab3828698199718a3d2f2faf8826f77d9258f7 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 9 Sep 2025 21:40:07 +0200 Subject: ... --- accounts/gkleen@sif/niri/default.nix | 39 +++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'accounts/gkleen@sif/niri') diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix index e1eca4c4..1ff149bc 100644 --- a/accounts/gkleen@sif/niri/default.nix +++ b/accounts/gkleen@sif/niri/default.nix @@ -947,22 +947,6 @@ in { action = spawn swayosd-client "--brightness" "lower"; allow-when-locked = true; }; - "XF86AudioRaiseVolume" = { - action = spawn swayosd-client "--output-volume" "raise"; - allow-when-locked = true; - }; - "XF86AudioLowerVolume" = { - action = spawn swayosd-client "--output-volume" "lower"; - allow-when-locked = true; - }; - "XF86AudioMute" = { - action = spawn swayosd-client "--output-volume" "mute-toggle"; - allow-when-locked = true; - }; - "XF86AudioMicMute" = { - action = spawn swayosd-client "--input-volume" "mute-toggle"; - allow-when-locked = true; - }; "Mod+Semicolon".action = spawn makoctl "dismiss" "--group"; "Mod+Shift+Semicolon".action = spawn makoctl "dismiss" "--all"; @@ -982,6 +966,29 @@ in { "Mod+K".action = spawn (lib.getExe' pkgs.worktime "worktime-ui"); "Mod+Shift+K".action = spawn (lib.getExe' pkgs.worktime "worktime-stop"); })) + (lib.mapAttrsToList (name: cfg: node name [(lib.removeAttrs cfg ["action"])] [cfg.action]) (let + shell = obj: leaf "send-unix" [ + { path = ''''${XDG_RUNTIME_DIR}/shell.sock''; } + (builtins.toJSON obj + "\n") + ]; + in { + "XF86AudioRaiseVolume" = { + allow-when-locked = true; + action = shell { Volume.volume = "up"; }; + }; + "XF86AudioLowerVolume" = { + allow-when-locked = true; + action = shell { Volume.volume = "down"; }; + }; + "XF86AudioMute" = { + allow-when-locked = true; + action = shell { Volume.muted = "toggle"; }; + }; + "XF86AudioMicMute" = { + allow-when-locked = true; + action = shell { Volume."mic-muted" = "toggle"; }; + }; + })) (map ({ name, selector, spawn, key, ...}: if key != null && selector != null && spawn != null then bind key { action = focus-or-spawn-action selector name spawn; } else null) cfg.scratchspaces) (map ({ name, moveKey, ...}: if moveKey != null then bind moveKey { action = kdl.magic-leaf "move-column-to-workspace" name; } else null) cfg.scratchspaces) ] -- cgit v1.2.3