diff options
Diffstat (limited to 'accounts/gkleen@sif/niri/default.nix')
-rw-r--r-- | accounts/gkleen@sif/niri/default.nix | 78 |
1 files changed, 32 insertions, 46 deletions
diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix index 35a3d799..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 = { |
@@ -231,25 +229,7 @@ in { | |||
231 | }; | 229 | }; |
232 | 230 | ||
233 | config = { | 231 | config = { |
234 | systemd.user.services.xwayland-satellite = { | 232 | home.packages = [ pkgs.xwayland-satellite-unstable ]; |
235 | Unit = { | ||
236 | BindsTo = [ "graphical-session.target" ]; | ||
237 | PartOf = [ "graphical-session.target" ]; | ||
238 | After = [ "graphical-session.target" ]; | ||
239 | Requisite = [ "graphical-session.target" ]; | ||
240 | }; | ||
241 | Service = { | ||
242 | Type = "notify"; | ||
243 | NotifyAccess = "all"; | ||
244 | Environment = [ "DISPLAY=:0" ]; | ||
245 | ExecStart = ''${lib.getExe pkgs.xwayland-satellite-unstable} ''${DISPLAY}''; | ||
246 | ExecStartPre = "${systemctl} --user import-environment DISPLAY"; | ||
247 | StandardOutput = "journal"; | ||
248 | }; | ||
249 | Install = { | ||
250 | WantedBy = [ "graphical-session.target" ]; | ||
251 | }; | ||
252 | }; | ||
253 | 233 | ||
254 | services.swayidle = { | 234 | services.swayidle = { |
255 | events = [ | 235 | events = [ |
@@ -957,31 +937,6 @@ in { | |||
957 | allow-when-locked = true; | 937 | allow-when-locked = true; |
958 | }; | 938 | }; |
959 | 939 | ||
960 | "XF86MonBrightnessUp" = { | ||
961 | action = spawn swayosd-client "--brightness" "raise"; | ||
962 | allow-when-locked = true; | ||
963 | }; | ||
964 | "XF86MonBrightnessDown" = { | ||
965 | action = spawn swayosd-client "--brightness" "lower"; | ||
966 | allow-when-locked = true; | ||
967 | }; | ||
968 | "XF86AudioRaiseVolume" = { | ||
969 | action = spawn swayosd-client "--output-volume" "raise"; | ||
970 | allow-when-locked = true; | ||
971 | }; | ||
972 | "XF86AudioLowerVolume" = { | ||
973 | action = spawn swayosd-client "--output-volume" "lower"; | ||
974 | allow-when-locked = true; | ||
975 | }; | ||
976 | "XF86AudioMute" = { | ||
977 | action = spawn swayosd-client "--output-volume" "mute-toggle"; | ||
978 | allow-when-locked = true; | ||
979 | }; | ||
980 | "XF86AudioMicMute" = { | ||
981 | action = spawn swayosd-client "--input-volume" "mute-toggle"; | ||
982 | allow-when-locked = true; | ||
983 | }; | ||
984 | |||
985 | "Mod+Semicolon".action = spawn makoctl "dismiss" "--group"; | 940 | "Mod+Semicolon".action = spawn makoctl "dismiss" "--group"; |
986 | "Mod+Shift+Semicolon".action = spawn makoctl "dismiss" "--all"; | 941 | "Mod+Shift+Semicolon".action = spawn makoctl "dismiss" "--all"; |
987 | "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"; |
@@ -1000,6 +955,37 @@ in { | |||
1000 | "Mod+K".action = spawn (lib.getExe' pkgs.worktime "worktime-ui"); | 955 | "Mod+K".action = spawn (lib.getExe' pkgs.worktime "worktime-ui"); |
1001 | "Mod+Shift+K".action = spawn (lib.getExe' pkgs.worktime "worktime-stop"); | 956 | "Mod+Shift+K".action = spawn (lib.getExe' pkgs.worktime "worktime-stop"); |
1002 | })) | 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 | })) | ||
1003 | (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) |
1004 | (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) |
1005 | ] | 991 | ] |