diff options
Diffstat (limited to 'accounts/gkleen@sif/niri')
-rw-r--r-- | accounts/gkleen@sif/niri/default.nix | 78 | ||||
-rw-r--r-- | accounts/gkleen@sif/niri/swayosd.nix | 66 |
2 files changed, 32 insertions, 112 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 | ] |
diff --git a/accounts/gkleen@sif/niri/swayosd.nix b/accounts/gkleen@sif/niri/swayosd.nix deleted file mode 100644 index 54ebb302..00000000 --- a/accounts/gkleen@sif/niri/swayosd.nix +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | { pkgs, ... }: | ||
2 | { | ||
3 | config = { | ||
4 | services.swayosd = { | ||
5 | enable = true; | ||
6 | topMargin = 0.4769706078; | ||
7 | stylePath = pkgs.runCommand "style.css" { | ||
8 | passAsFile = [ "src" ]; | ||
9 | src = '' | ||
10 | window#osd { | ||
11 | padding: 12px 20px; | ||
12 | border-radius: 999px; | ||
13 | border: none; | ||
14 | background: rgba(0, 0, 0, 0.87); | ||
15 | |||
16 | #container { | ||
17 | margin: 16px; | ||
18 | } | ||
19 | |||
20 | image, | ||
21 | label { | ||
22 | color: rgb(255, 255, 255); | ||
23 | |||
24 | &:disabled { | ||
25 | opacity: 1; | ||
26 | color: rgb(84, 84, 84); | ||
27 | } | ||
28 | } | ||
29 | |||
30 | progressbar { | ||
31 | min-height: 6px; | ||
32 | border-radius: 999px; | ||
33 | background: transparent; | ||
34 | border: none; | ||
35 | |||
36 | trough, progress { | ||
37 | min-height: inherit; | ||
38 | border-radius: inherit; | ||
39 | border: none; | ||
40 | } | ||
41 | |||
42 | trough { | ||
43 | background: rgb(127, 127, 127); | ||
44 | } | ||
45 | progress { | ||
46 | background: rgb(255, 255, 255); | ||
47 | } | ||
48 | |||
49 | &:disabled { | ||
50 | opacity: 1; | ||
51 | |||
52 | trough { | ||
53 | background: rgb(19, 19, 19); | ||
54 | } | ||
55 | progress { | ||
56 | background: rgb(38, 38, 38); | ||
57 | } | ||
58 | } | ||
59 | } | ||
60 | } | ||
61 | ''; | ||
62 | buildInputs = with pkgs; [sass]; | ||
63 | } "scss -C --sourcemap=none --style=compact $srcPath $out"; | ||
64 | }; | ||
65 | }; | ||
66 | } | ||