summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/niri/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/niri/default.nix')
-rw-r--r--accounts/gkleen@sif/niri/default.nix58
1 files changed, 31 insertions, 27 deletions
diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix
index e1eca4c4..10b85169 100644
--- a/accounts/gkleen@sif/niri/default.nix
+++ b/accounts/gkleen@sif/niri/default.nix
@@ -10,7 +10,6 @@ let
10 makoctl = lib.getExe' config.services.mako.package "makoctl"; 10 makoctl = lib.getExe' config.services.mako.package "makoctl";
11 loginctl = lib.getExe' hostConfig.systemd.package "loginctl"; 11 loginctl = lib.getExe' hostConfig.systemd.package "loginctl";
12 systemctl = lib.getExe' hostConfig.systemd.package "systemctl"; 12 systemctl = lib.getExe' hostConfig.systemd.package "systemctl";
13 swayosd-client = lib.getExe' config.services.swayosd.package "swayosd-client";
14 13
15 focus_or_spawn = pkgs.writeShellApplication { 14 focus_or_spawn = pkgs.writeShellApplication {
16 name = "focus-or-spawn"; 15 name = "focus-or-spawn";
@@ -168,7 +167,6 @@ in {
168 imports = [ 167 imports = [
169 ./waybar.nix 168 ./waybar.nix
170 ./mako.nix 169 ./mako.nix
171 ./swayosd.nix
172 ]; 170 ];
173 171
174 options = { 172 options = {
@@ -939,31 +937,6 @@ in {
939 allow-when-locked = true; 937 allow-when-locked = true;
940 }; 938 };
941 939
942 "XF86MonBrightnessUp" = {
943 action = spawn swayosd-client "--brightness" "raise";
944 allow-when-locked = true;
945 };
946 "XF86MonBrightnessDown" = {
947 action = spawn swayosd-client "--brightness" "lower";
948 allow-when-locked = true;
949 };
950 "XF86AudioRaiseVolume" = {
951 action = spawn swayosd-client "--output-volume" "raise";
952 allow-when-locked = true;
953 };
954 "XF86AudioLowerVolume" = {
955 action = spawn swayosd-client "--output-volume" "lower";
956 allow-when-locked = true;
957 };
958 "XF86AudioMute" = {
959 action = spawn swayosd-client "--output-volume" "mute-toggle";
960 allow-when-locked = true;
961 };
962 "XF86AudioMicMute" = {
963 action = spawn swayosd-client "--input-volume" "mute-toggle";
964 allow-when-locked = true;
965 };
966
967 "Mod+Semicolon".action = spawn makoctl "dismiss" "--group"; 940 "Mod+Semicolon".action = spawn makoctl "dismiss" "--group";
968 "Mod+Shift+Semicolon".action = spawn makoctl "dismiss" "--all"; 941 "Mod+Shift+Semicolon".action = spawn makoctl "dismiss" "--all";
969 "Mod+Period".action = spawn makoctl "menu" "--" (lib.getExe config.programs.fuzzel.package) "--dmenu"; 942 "Mod+Period".action = spawn makoctl "menu" "--" (lib.getExe config.programs.fuzzel.package) "--dmenu";
@@ -982,6 +955,37 @@ in {
982 "Mod+K".action = spawn (lib.getExe' pkgs.worktime "worktime-ui"); 955 "Mod+K".action = spawn (lib.getExe' pkgs.worktime "worktime-ui");
983 "Mod+Shift+K".action = spawn (lib.getExe' pkgs.worktime "worktime-stop"); 956 "Mod+Shift+K".action = spawn (lib.getExe' pkgs.worktime "worktime-stop");
984 })) 957 }))
958 (lib.mapAttrsToList (name: cfg: node name [(lib.removeAttrs cfg ["action"])] [cfg.action]) (let
959 shell = obj: leaf "send-unix" [
960 { path = ''''${XDG_RUNTIME_DIR}/shell.sock''; }
961 (builtins.toJSON obj + "\n")
962 ];
963 in {
964 "XF86AudioRaiseVolume" = {
965 allow-when-locked = true;
966 action = shell { Volume.volume = "up"; };
967 };
968 "XF86AudioLowerVolume" = {
969 allow-when-locked = true;
970 action = shell { Volume.volume = "down"; };
971 };
972 "XF86AudioMute" = {
973 allow-when-locked = true;
974 action = shell { Volume.muted = "toggle"; };
975 };
976 "XF86AudioMicMute" = {
977 allow-when-locked = true;
978 action = shell { Volume."mic-muted" = "toggle"; };
979 };
980 "XF86MonBrightnessUp" = {
981 action = shell { Brightness = "up"; };
982 allow-when-locked = true;
983 };
984 "XF86MonBrightnessDown" = {
985 action = shell { Brightness = "down"; };
986 allow-when-locked = true;
987 };
988 }))
985 (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) 989 (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)
986 (map ({ name, moveKey, ...}: if moveKey != null then bind moveKey { action = kdl.magic-leaf "move-column-to-workspace" name; } else null) cfg.scratchspaces) 990 (map ({ name, moveKey, ...}: if moveKey != null then bind moveKey { action = kdl.magic-leaf "move-column-to-workspace" name; } else null) cfg.scratchspaces)
987 ] 991 ]