diff options
author | Minijackson <minijackson@riseup.net> | 2024-08-04 17:49:07 +0200 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2024-08-04 17:49:07 +0200 |
commit | 782e61ea00fb81092cd05b949d6db885b30506dc (patch) | |
tree | 6ff0bf7151e42669de1d842249883a080cd461fd /usecases | |
parent | 7696351112686b77158a096d569c8272a0f4bb23 (diff) | |
download | nixos-config-reborn-782e61ea00fb81092cd05b949d6db885b30506dc.tar.gz nixos-config-reborn-782e61ea00fb81092cd05b949d6db885b30506dc.zip |
usecases/sway: move from mako to swaync for notifications
And adapt waybar for it
Diffstat (limited to 'usecases')
-rw-r--r-- | usecases/desktop/graphical/sway.nix | 608 | ||||
-rw-r--r-- | usecases/desktop/graphical/swaync.css | 257 | ||||
-rw-r--r-- | usecases/desktop/graphical/waybar.nix | 40 |
3 files changed, 596 insertions, 309 deletions
diff --git a/usecases/desktop/graphical/sway.nix b/usecases/desktop/graphical/sway.nix index 815f787..7e66796 100644 --- a/usecases/desktop/graphical/sway.nix +++ b/usecases/desktop/graphical/sway.nix | |||
@@ -1,319 +1,346 @@ | |||
1 | _inputs: { | 1 | _inputs: |
2 | lib, | 2 | { lib, pkgs, ... }: |
3 | pkgs, | 3 | { |
4 | ... | ||
5 | }: { | ||
6 | services.greetd = { | 4 | services.greetd = { |
7 | enable = true; | 5 | enable = true; |
8 | vt = 6; | 6 | vt = 6; |
9 | settings.default_session.command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd sway"; | 7 | settings.default_session.command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd sway"; |
10 | }; | 8 | }; |
11 | 9 | ||
12 | home-manager.users.minijackson = { | 10 | home-manager.users.minijackson = |
13 | config, | 11 | { config, osConfig, ... }: |
14 | osConfig, | 12 | { |
15 | ... | 13 | wayland.windowManager.sway = { |
16 | }: { | 14 | enable = true; |
17 | wayland.windowManager.sway = { | 15 | |
18 | enable = true; | 16 | extraSessionCommands = |
19 | 17 | let | |
20 | extraSessionCommands = let | 18 | schema = pkgs.gsettings-desktop-schemas; |
21 | schema = pkgs.gsettings-desktop-schemas; | 19 | datadir = "${schema}/share/gsettings-schemas/${schema.name}"; |
22 | datadir = "${schema}/share/gsettings-schemas/${schema.name}"; | 20 | in |
23 | in '' | 21 | '' |
24 | # https://github.com/emersion/xdg-desktop-portal-wlr/issues/20 | 22 | # https://github.com/emersion/xdg-desktop-portal-wlr/issues/20 |
25 | export XDG_CURRENT_DESKTOP=sway | 23 | export XDG_CURRENT_DESKTOP=sway |
26 | # https://github.com/emersion/xdg-desktop-portal-wlr/pull/11 | 24 | # https://github.com/emersion/xdg-desktop-portal-wlr/pull/11 |
27 | export XDG_SESSION_TYPE=wayland | 25 | export XDG_SESSION_TYPE=wayland |
28 | 26 | ||
29 | # Makes gsettings work | 27 | # Makes gsettings work |
30 | export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS | 28 | export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS |
31 | 29 | ||
32 | export SDL_VIDEODRIVER=wayland | 30 | export SDL_VIDEODRIVER=wayland |
33 | 31 | ||
34 | export QT_QPA_PLATFORM=wayland | 32 | export QT_QPA_PLATFORM=wayland |
35 | export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 | 33 | export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 |
36 | ''; | 34 | ''; |
37 | 35 | ||
38 | wrapperFeatures.gtk = true; | 36 | wrapperFeatures.gtk = true; |
39 | 37 | ||
40 | config = { | 38 | config = { |
41 | workspaceLayout = "tabbed"; | 39 | workspaceLayout = "tabbed"; |
42 | 40 | ||
43 | # Using waybar | 41 | # Using waybar |
44 | bars = []; | 42 | bars = [ ]; |
45 | 43 | ||
46 | colors = with osConfig.theme.colors; { | 44 | colors = with osConfig.theme.colors; { |
47 | focused = { | 45 | focused = { |
48 | border = lightBackground; | 46 | border = lightBackground; |
49 | background = lightBackground; | 47 | background = lightBackground; |
50 | text = foreground; | 48 | text = foreground; |
51 | indicator = dominant; | 49 | indicator = dominant; |
52 | childBorder = dominant; | 50 | childBorder = dominant; |
51 | }; | ||
52 | |||
53 | focusedInactive = { | ||
54 | border = background; | ||
55 | background = background; | ||
56 | text = dimForeground; | ||
57 | indicator = dominant; | ||
58 | childBorder = background; | ||
59 | }; | ||
60 | |||
61 | unfocused = { | ||
62 | border = background; | ||
63 | background = background; | ||
64 | text = dimForeground; | ||
65 | indicator = dominant; | ||
66 | childBorder = background; | ||
67 | }; | ||
68 | |||
69 | urgent = { | ||
70 | border = brightRed; | ||
71 | background = brightRed; | ||
72 | text = foreground; | ||
73 | indicator = brightRed; | ||
74 | childBorder = brightRed; | ||
75 | }; | ||
76 | |||
77 | placeholder = { | ||
78 | border = background0; | ||
79 | background = background0; | ||
80 | text = foreground; | ||
81 | indicator = background0; | ||
82 | childBorder = background0; | ||
83 | }; | ||
53 | }; | 84 | }; |
54 | 85 | ||
55 | focusedInactive = { | 86 | floating.criteria = [ { title = "Steam - News"; } ]; |
56 | border = background; | 87 | |
57 | background = background; | 88 | input = { |
58 | text = dimForeground; | 89 | "*" = { |
59 | indicator = dominant; | 90 | xkb_options = "compose:caps"; |
60 | childBorder = background; | 91 | }; |
92 | |||
93 | "1:1:AT_Translated_Set_2_keyboard" = { | ||
94 | xkb_layout = "fr"; | ||
95 | xkb_variant = "oss"; | ||
96 | xkb_options = "compose:caps"; | ||
97 | xkb_numlock = "enabled"; | ||
98 | }; | ||
99 | |||
100 | "1452:514:Alps_Electric_M2452" = { | ||
101 | xkb_layout = "fr"; | ||
102 | xkb_variant = "oss"; | ||
103 | xkb_options = "compose:caps,lv3:rwin_switch"; | ||
104 | xkb_numlock = "enabled"; | ||
105 | }; | ||
106 | |||
107 | "7764:8240:TypeMatrix.com_USB_Keyboard" = { | ||
108 | xkb_layout = "us"; | ||
109 | xkb_variant = "dvorak"; | ||
110 | xkb_options = "eurosign:e,compose:caps"; | ||
111 | xkb_numlock = "enabled"; | ||
112 | }; | ||
113 | |||
114 | "1133:49948:Logitech_USB_Keyboard" = { | ||
115 | xkb_layout = "fr"; | ||
116 | xkb_variant = "oss"; | ||
117 | xkb_options = "eurosign:e,compose:caps"; | ||
118 | xkb_numlock = "enabled"; | ||
119 | }; | ||
120 | |||
121 | "1102:4639:DELL0817:00_044E:121F_Mouse" = { | ||
122 | scroll_method = "on_button_down"; | ||
123 | scroll_button = "button2"; | ||
124 | }; | ||
61 | }; | 125 | }; |
62 | 126 | ||
63 | unfocused = { | 127 | keybindings = |
64 | border = background; | 128 | let |
65 | background = background; | 129 | modifier = config.wayland.windowManager.sway.config.modifier; |
66 | text = dimForeground; | 130 | inherit (lib) getExe; |
67 | indicator = dominant; | 131 | inherit (pkgs) |
68 | childBorder = background; | 132 | brightnessctl |
69 | }; | 133 | grim |
70 | 134 | pamixer | |
71 | urgent = { | 135 | slurp |
72 | border = brightRed; | 136 | ; |
73 | background = brightRed; | 137 | in |
74 | text = foreground; | 138 | lib.mkOptionDefault { |
75 | indicator = brightRed; | 139 | "${modifier}+ampersand" = "workspace 1"; |
76 | childBorder = brightRed; | 140 | "${modifier}+eacute" = "workspace 2"; |
77 | }; | 141 | "${modifier}+quotedbl" = "workspace 3"; |
78 | 142 | "${modifier}+apostrophe" = "workspace 4"; | |
79 | placeholder = { | 143 | "${modifier}+parenleft" = "workspace 5"; |
80 | border = background0; | 144 | "${modifier}+minus" = "workspace 6"; |
81 | background = background0; | 145 | "${modifier}+egrave" = "workspace 7"; |
82 | text = foreground; | 146 | "${modifier}+underscore" = "workspace 8"; |
83 | indicator = background0; | 147 | "${modifier}+ccedilla" = "workspace 9"; |
84 | childBorder = background0; | 148 | "${modifier}+agrave" = "workspace 10"; |
149 | |||
150 | "${modifier}+Shift+ampersand" = "move container to workspace 1"; | ||
151 | "${modifier}+Shift+eacute" = "move container to workspace 2"; | ||
152 | "${modifier}+Shift+quotedbl" = "move container to workspace 3"; | ||
153 | "${modifier}+Shift+apostrophe" = "move container to workspace 4"; | ||
154 | "${modifier}+Shift+parenleft" = "move container to workspace 5"; | ||
155 | "${modifier}+Shift+minus" = "move container to workspace 6"; | ||
156 | "${modifier}+Shift+egrave" = "move container to workspace 7"; | ||
157 | "${modifier}+Shift+underscore" = "move container to workspace 8"; | ||
158 | "${modifier}+Shift+ccedilla" = "move container to workspace 9"; | ||
159 | "${modifier}+Shift+agrave" = "move container to workspace 10"; | ||
160 | |||
161 | "${modifier}+Ctrl+h" = "move workspace to output left"; | ||
162 | "${modifier}+Ctrl+j" = "move workspace to output down"; | ||
163 | "${modifier}+Ctrl+k" = "move workspace to output up"; | ||
164 | "${modifier}+Ctrl+l" = "move workspace to output right"; | ||
165 | |||
166 | "${modifier}+Ctrl+Left" = "move workspace to output left"; | ||
167 | "${modifier}+Ctrl+Down" = "move workspace to output down"; | ||
168 | "${modifier}+Ctrl+Up" = "move workspace to output up"; | ||
169 | "${modifier}+Ctrl+Right" = "move workspace to output right"; | ||
170 | |||
171 | "${modifier}+n" = "split none"; | ||
172 | |||
173 | "${modifier}+comma" = "exec swaync-client --close-latest"; | ||
174 | "${modifier}+Shift+comma" = "exec swaync-client --close-all"; | ||
175 | "${modifier}+period" = "exec swaync-client --toggle-panel"; | ||
176 | |||
177 | "${modifier}+m" = "exec ${pkgs.swaylock}/bin/swaylock"; | ||
178 | |||
179 | "${modifier}+c" = "exec rofi -show calc -modi calc -no-sort -no-persist-history -calc-command 'echo -n {result} | wl-copy'"; | ||
180 | "${modifier}+p" = "exec rofi-pass"; | ||
181 | |||
182 | "XF86AudioRaiseVolume" = "exec ${getExe pamixer} -i 5"; | ||
183 | "XF86AudioLowerVolume" = "exec ${getExe pamixer} -d 5"; | ||
184 | "XF86AudioMute" = "exec ${getExe pamixer} -t"; | ||
185 | |||
186 | "XF86MonBrightnessUp" = "exec ${getExe brightnessctl} set -- +10%"; | ||
187 | "XF86MonBrightnessDown" = "exec ${getExe brightnessctl} set -- -10%"; | ||
188 | |||
189 | "Print" = "exec ${getExe grim}"; | ||
190 | "Shift+Print" = "exec ${getExe slurp} | ${getExe grim} -g -"; | ||
191 | }; | ||
192 | |||
193 | menu = '' | ||
194 | rofi -show drun -terminal alacritty -modi "drun,run,emoji,keys" | ||
195 | ''; | ||
196 | |||
197 | modifier = "Mod4"; | ||
198 | |||
199 | output."*".bg = "${../../../res/wallpapers/wallpaper-1920x1080-kernel-card-black.png} fill"; | ||
200 | |||
201 | startup = [ { command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; } ]; | ||
202 | |||
203 | terminal = "${pkgs.alacritty}/bin/alacritty"; | ||
204 | |||
205 | window = { | ||
206 | border = 2; | ||
207 | hideEdgeBorders = "smart"; | ||
85 | }; | 208 | }; |
86 | }; | 209 | }; |
210 | }; | ||
87 | 211 | ||
88 | floating.criteria = [ | 212 | services.swaync = { |
89 | {title = "Steam - News";} | 213 | enable = true; |
90 | ]; | 214 | |
91 | 215 | settings = { | |
92 | input = { | 216 | widgets = [ |
93 | "*" = { | 217 | "buttons-grid" |
94 | xkb_options = "compose:caps"; | 218 | "mpris" |
95 | }; | 219 | "volume" |
96 | 220 | "backlight" | |
97 | "1:1:AT_Translated_Set_2_keyboard" = { | 221 | "inhibitors" |
98 | xkb_layout = "fr"; | 222 | "title" |
99 | xkb_variant = "oss"; | 223 | "dnd" |
100 | xkb_options = "compose:caps"; | 224 | "notifications" |
101 | xkb_numlock = "enabled"; | 225 | ]; |
102 | }; | 226 | widget-config = { |
103 | 227 | buttons-grid.actions = [ | |
104 | "1452:514:Alps_Electric_M2452" = { | 228 | { |
105 | xkb_layout = "fr"; | 229 | label = ""; |
106 | xkb_variant = "oss"; | 230 | command = "swaylock"; |
107 | xkb_options = "compose:caps,lv3:rwin_switch"; | 231 | } |
108 | xkb_numlock = "enabled"; | 232 | { |
109 | }; | 233 | label = ""; |
110 | 234 | command = "systemctl reboot"; | |
111 | "7764:8240:TypeMatrix.com_USB_Keyboard" = { | 235 | } |
112 | xkb_layout = "us"; | 236 | { |
113 | xkb_variant = "dvorak"; | 237 | label = ""; |
114 | xkb_options = "eurosign:e,compose:caps"; | 238 | command = "systemctl poweroff"; |
115 | xkb_numlock = "enabled"; | 239 | } |
240 | ]; | ||
241 | volume = { | ||
242 | label = ""; | ||
243 | show-per-app = true; | ||
244 | show-per-app-label = true; | ||
245 | }; | ||
116 | }; | 246 | }; |
247 | }; | ||
117 | 248 | ||
118 | "1133:49948:Logitech_USB_Keyboard" = { | 249 | style = pkgs.substituteAll { |
119 | xkb_layout = "fr"; | 250 | src = ./swaync.css; |
120 | xkb_variant = "oss"; | 251 | inherit (osConfig.theme.colors) |
121 | xkb_options = "eurosign:e,compose:caps"; | 252 | background1 |
122 | xkb_numlock = "enabled"; | 253 | background2 |
123 | }; | 254 | background5 |
255 | dimDominant | ||
256 | dominant | ||
257 | foreground | ||
258 | foreground3 | ||
259 | softBackground | ||
260 | ; | ||
261 | }; | ||
262 | }; | ||
124 | 263 | ||
125 | "1102:4639:DELL0817:00_044E:121F_Mouse" = { | 264 | services.wlsunset = { |
126 | scroll_method = "on_button_down"; | 265 | enable = true; |
127 | scroll_button = "button2"; | 266 | latitude = "48.864716"; |
128 | }; | 267 | longitude = "2.349014"; |
268 | # Reduce blue light anyways | ||
269 | temperature = { | ||
270 | day = 4000; | ||
271 | night = 2500; | ||
129 | }; | 272 | }; |
273 | }; | ||
130 | 274 | ||
131 | keybindings = let | 275 | programs.swaylock = { |
132 | modifier = config.wayland.windowManager.sway.config.modifier; | 276 | enable = true; |
133 | inherit (lib) getExe; | 277 | settings = |
134 | inherit (pkgs) brightnessctl grim pamixer slurp; | 278 | let |
135 | in | 279 | inherit (osConfig.theme.colors) |
136 | lib.mkOptionDefault { | 280 | background |
137 | "${modifier}+ampersand" = "workspace 1"; | 281 | brightGreen |
138 | "${modifier}+eacute" = "workspace 2"; | 282 | brightOrange |
139 | "${modifier}+quotedbl" = "workspace 3"; | 283 | brightRed |
140 | "${modifier}+apostrophe" = "workspace 4"; | 284 | dominant |
141 | "${modifier}+parenleft" = "workspace 5"; | 285 | neutralOrange |
142 | "${modifier}+minus" = "workspace 6"; | 286 | neutralRed |
143 | "${modifier}+egrave" = "workspace 7"; | 287 | ; |
144 | "${modifier}+underscore" = "workspace 8"; | 288 | in |
145 | "${modifier}+ccedilla" = "workspace 9"; | 289 | { |
146 | "${modifier}+agrave" = "workspace 10"; | 290 | ignore-empty-password = true; |
147 | 291 | show-failed-attempts = true; | |
148 | "${modifier}+Shift+ampersand" = "move container to workspace 1"; | ||
149 | "${modifier}+Shift+eacute" = "move container to workspace 2"; | ||
150 | "${modifier}+Shift+quotedbl" = "move container to workspace 3"; | ||
151 | "${modifier}+Shift+apostrophe" = "move container to workspace 4"; | ||
152 | "${modifier}+Shift+parenleft" = "move container to workspace 5"; | ||
153 | "${modifier}+Shift+minus" = "move container to workspace 6"; | ||
154 | "${modifier}+Shift+egrave" = "move container to workspace 7"; | ||
155 | "${modifier}+Shift+underscore" = "move container to workspace 8"; | ||
156 | "${modifier}+Shift+ccedilla" = "move container to workspace 9"; | ||
157 | "${modifier}+Shift+agrave" = "move container to workspace 10"; | ||
158 | |||
159 | "${modifier}+Ctrl+h" = "move workspace to output left"; | ||
160 | "${modifier}+Ctrl+j" = "move workspace to output down"; | ||
161 | "${modifier}+Ctrl+k" = "move workspace to output up"; | ||
162 | "${modifier}+Ctrl+l" = "move workspace to output right"; | ||
163 | |||
164 | "${modifier}+Ctrl+Left" = "move workspace to output left"; | ||
165 | "${modifier}+Ctrl+Down" = "move workspace to output down"; | ||
166 | "${modifier}+Ctrl+Up" = "move workspace to output up"; | ||
167 | "${modifier}+Ctrl+Right" = "move workspace to output right"; | ||
168 | |||
169 | "${modifier}+n" = "split none"; | ||
170 | |||
171 | "${modifier}+comma" = "exec makoctl dismiss"; | ||
172 | "${modifier}+Shift+comma" = "exec makoctl dismiss --all"; | ||
173 | "${modifier}+period" = "exec makoctl menu rofi -dmenu -no-custom"; | ||
174 | |||
175 | "${modifier}+m" = "exec ${pkgs.swaylock}/bin/swaylock"; | ||
176 | |||
177 | "${modifier}+c" = "exec rofi -show calc -modi calc -no-sort -no-persist-history -calc-command 'echo -n {result} | wl-copy'"; | ||
178 | "${modifier}+p" = "exec rofi-pass"; | ||
179 | |||
180 | "XF86AudioRaiseVolume" = "exec ${getExe pamixer} -i 5"; | ||
181 | "XF86AudioLowerVolume" = "exec ${getExe pamixer} -d 5"; | ||
182 | "XF86AudioMute" = "exec ${getExe pamixer} -t"; | ||
183 | |||
184 | "XF86MonBrightnessUp" = "exec ${getExe brightnessctl} set -- +10%"; | ||
185 | "XF86MonBrightnessDown" = "exec ${getExe brightnessctl} set -- -10%"; | ||
186 | |||
187 | "Print" = "exec ${getExe grim}"; | ||
188 | "Shift+Print" = "exec ${getExe slurp} | ${getExe grim} -g -"; | ||
189 | }; | ||
190 | 292 | ||
191 | menu = '' | 293 | image = "${../../../res/wallpapers/wallpaper-1920x1080-install-gentoo.png}"; |
192 | rofi -show drun -terminal alacritty -modi "drun,run,emoji,keys" | ||
193 | ''; | ||
194 | 294 | ||
195 | modifier = "Mod4"; | 295 | font = "monospace"; |
196 | 296 | ||
197 | output."*".bg = "${../../../res/wallpapers/wallpaper-1920x1080-kernel-card-black.png} fill"; | 297 | inside-color = "${lib.removePrefix "#" dominant}dd"; |
298 | inside-clear-color = "${lib.removePrefix "#" neutralOrange}dd"; | ||
299 | inside-ver-color = "${lib.removePrefix "#" neutralOrange}dd"; | ||
300 | inside-wrong-color = "${lib.removePrefix "#" neutralRed}dd"; | ||
198 | 301 | ||
199 | startup = [ | 302 | key-hl-color = "${lib.removePrefix "#" brightGreen}ee"; |
200 | # TODO: use systemd user service | 303 | bs-hl-color = "${lib.removePrefix "#" neutralRed}ee"; |
201 | { | ||
202 | command = "mako"; | ||
203 | always = true; | ||
204 | } | ||
205 | {command = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1";} | ||
206 | ]; | ||
207 | 304 | ||
208 | terminal = "${pkgs.alacritty}/bin/alacritty"; | 305 | line-color = "${lib.removePrefix "#" background}ee"; |
306 | line-clear-color = "${lib.removePrefix "#" background}ee"; | ||
307 | line-ver-color = "${lib.removePrefix "#" background}ee"; | ||
308 | line-wrong-color = "${lib.removePrefix "#" background}ee"; | ||
209 | 309 | ||
210 | window = { | 310 | ring-color = "${lib.removePrefix "#" dominant}ee"; |
211 | border = 2; | 311 | ring-clear-color = "${lib.removePrefix "#" brightOrange}ee"; |
212 | hideEdgeBorders = "smart"; | 312 | ring-ver-color = "${lib.removePrefix "#" brightOrange}ee"; |
213 | }; | 313 | ring-wrong-color = "${lib.removePrefix "#" brightRed}ee"; |
214 | }; | ||
215 | }; | ||
216 | 314 | ||
217 | services.mako = let | 315 | separator-color = "${lib.removePrefix "#" background}ee"; |
218 | inherit (osConfig.theme.colors) background0 dimDominant foreground neutralBlue; | ||
219 | in { | ||
220 | enable = true; | ||
221 | backgroundColor = background0; | ||
222 | borderColor = dimDominant; | ||
223 | borderSize = 2; | ||
224 | progressColor = neutralBlue; | ||
225 | textColor = foreground; | ||
226 | |||
227 | margin = "15"; | ||
228 | padding = "7"; | ||
229 | |||
230 | groupBy = "app-name"; | ||
231 | |||
232 | extraConfig = '' | ||
233 | [mode=do-not-disturb] | ||
234 | invisible=1 | ||
235 | ''; | ||
236 | }; | ||
237 | 316 | ||
238 | services.wlsunset = { | 317 | text-color = "${lib.removePrefix "#" background}ff"; |
239 | enable = true; | 318 | text-clear-color = "${lib.removePrefix "#" background}ff"; |
240 | latitude = "48.864716"; | 319 | text-ver-color = "${lib.removePrefix "#" background}ff"; |
241 | longitude = "2.349014"; | 320 | text-wrong-color = "${lib.removePrefix "#" background}ff"; |
242 | # Reduce blue light anyways | ||
243 | temperature = { | ||
244 | day = 4000; | ||
245 | night = 2500; | ||
246 | }; | ||
247 | }; | ||
248 | 321 | ||
249 | programs.swaylock = { | 322 | indicator-radius = 75; |
250 | enable = true; | 323 | indicator-thickness = 10; |
251 | settings = let | 324 | }; |
252 | inherit | ||
253 | (osConfig.theme.colors) | ||
254 | background | ||
255 | brightGreen | ||
256 | brightOrange | ||
257 | brightRed | ||
258 | dominant | ||
259 | neutralOrange | ||
260 | neutralRed | ||
261 | ; | ||
262 | in { | ||
263 | ignore-empty-password = true; | ||
264 | show-failed-attempts = true; | ||
265 | |||
266 | image = "${../../../res/wallpapers/wallpaper-1920x1080-install-gentoo.png}"; | ||
267 | |||
268 | font = "monospace"; | ||
269 | |||
270 | inside-color = "${lib.removePrefix "#" dominant}dd"; | ||
271 | inside-clear-color = "${lib.removePrefix "#" neutralOrange}dd"; | ||
272 | inside-ver-color = "${lib.removePrefix "#" neutralOrange}dd"; | ||
273 | inside-wrong-color = "${lib.removePrefix "#" neutralRed}dd"; | ||
274 | |||
275 | key-hl-color = "${lib.removePrefix "#" brightGreen}ee"; | ||
276 | bs-hl-color = "${lib.removePrefix "#" neutralRed}ee"; | ||
277 | |||
278 | line-color = "${lib.removePrefix "#" background}ee"; | ||
279 | line-clear-color = "${lib.removePrefix "#" background}ee"; | ||
280 | line-ver-color = "${lib.removePrefix "#" background}ee"; | ||
281 | line-wrong-color = "${lib.removePrefix "#" background}ee"; | ||
282 | |||
283 | ring-color = "${lib.removePrefix "#" dominant}ee"; | ||
284 | ring-clear-color = "${lib.removePrefix "#" brightOrange}ee"; | ||
285 | ring-ver-color = "${lib.removePrefix "#" brightOrange}ee"; | ||
286 | ring-wrong-color = "${lib.removePrefix "#" brightRed}ee"; | ||
287 | |||
288 | separator-color = "${lib.removePrefix "#" background}ee"; | ||
289 | |||
290 | text-color = "${lib.removePrefix "#" background}ff"; | ||
291 | text-clear-color = "${lib.removePrefix "#" background}ff"; | ||
292 | text-ver-color = "${lib.removePrefix "#" background}ff"; | ||
293 | text-wrong-color = "${lib.removePrefix "#" background}ff"; | ||
294 | |||
295 | indicator-radius = 75; | ||
296 | indicator-thickness = 10; | ||
297 | }; | 325 | }; |
298 | }; | ||
299 | 326 | ||
300 | xsession.importedVariables = [ | 327 | xsession.importedVariables = [ |
301 | "DBUS_SESSION_BUS_ADDRESS" | 328 | "DBUS_SESSION_BUS_ADDRESS" |
302 | "DISPLAY" | 329 | "DISPLAY" |
303 | "SSH_AUTH_SOCK" | 330 | "SSH_AUTH_SOCK" |
304 | "XAUTHORITY" | 331 | "XAUTHORITY" |
305 | "XDG_DATA_DIRS" | 332 | "XDG_DATA_DIRS" |
306 | "XDG_RUNTIME_DIR" | 333 | "XDG_RUNTIME_DIR" |
307 | "XDG_SESSION_ID" | 334 | "XDG_SESSION_ID" |
308 | 335 | ||
309 | "WAYLAND_DISPLAY" | 336 | "WAYLAND_DISPLAY" |
310 | "SWAYSOCK" | 337 | "SWAYSOCK" |
311 | "I3SOCK" | 338 | "I3SOCK" |
312 | 339 | ||
313 | "XDG_CURRENT_DESKTOP" | 340 | "XDG_CURRENT_DESKTOP" |
314 | "XDG_SESSION_TYPE" | 341 | "XDG_SESSION_TYPE" |
315 | ]; | 342 | ]; |
316 | }; | 343 | }; |
317 | 344 | ||
318 | # TODO: polkit gnome | 345 | # TODO: polkit gnome |
319 | 346 | ||
@@ -325,10 +352,13 @@ _inputs: { | |||
325 | ]; | 352 | ]; |
326 | 353 | ||
327 | programs.xwayland.enable = true; | 354 | programs.xwayland.enable = true; |
328 | security.pam.services.swaylock = {}; | 355 | security.pam.services.swaylock = { }; |
329 | 356 | ||
330 | xdg.portal = { | 357 | xdg.portal = { |
331 | wlr.enable = true; | 358 | wlr.enable = true; |
332 | config.sway.default = ["wlr" "gtk"]; | 359 | config.sway.default = [ |
360 | "wlr" | ||
361 | "gtk" | ||
362 | ]; | ||
333 | }; | 363 | }; |
334 | } | 364 | } |
diff --git a/usecases/desktop/graphical/swaync.css b/usecases/desktop/graphical/swaync.css new file mode 100644 index 0000000..d3e103a --- /dev/null +++ b/usecases/desktop/graphical/swaync.css | |||
@@ -0,0 +1,257 @@ | |||
1 | /* Adapted from: https://pastebin.com/xycT4nrk */ | ||
2 | |||
3 | @define-color cc-bg @softBackground@; | ||
4 | @define-color noti-border-color @cc-bg; | ||
5 | @define-color noti-bg @background2@; | ||
6 | @define-color noti-bg-darker @background2@; | ||
7 | @define-color noti-bg-hover rgb(27, 27, 43); | ||
8 | @define-color noti-bg-focus rgba(27, 27, 27, 0.6); | ||
9 | @define-color text-color @foreground@; | ||
10 | @define-color text-color-disabled @foreground3@; | ||
11 | @define-color dominant @dominant@; | ||
12 | @define-color dimDominant @dimDominant@; | ||
13 | @define-color bg-selected @dominant; | ||
14 | @define-color border-color @background5@; | ||
15 | @define-color darker-bg @background1@; | ||
16 | |||
17 | * { | ||
18 | font-family: mono; | ||
19 | font-weight: bold; | ||
20 | font-size: 14px; | ||
21 | outline: none; | ||
22 | transition: all .1s ease-in-out; | ||
23 | } | ||
24 | |||
25 | /* Buttons */ | ||
26 | |||
27 | .close-button, | ||
28 | .notification-action, | ||
29 | .widget-buttons-grid>flowbox>flowboxchild>button, | ||
30 | .widget-menubar button, | ||
31 | .widget-title>button { | ||
32 | color: @text-color; | ||
33 | background-color: @cc-bg; | ||
34 | border: 1px solid @darker-bg; | ||
35 | border-radius: 5px; | ||
36 | box-shadow: none; | ||
37 | text-shadow: none; | ||
38 | } | ||
39 | |||
40 | .close-button:hover, | ||
41 | .notification-action:hover, | ||
42 | .widget-buttons-grid>flowbox>flowboxchild>button:hover, | ||
43 | .widget-menubar button:hover, | ||
44 | .widget-title>button:hover { | ||
45 | background-color: @dominant; | ||
46 | box-shadow: none; | ||
47 | text-shadow: none; | ||
48 | } | ||
49 | |||
50 | .control-center .notification-row:focus, | ||
51 | .control-center .notification-row:hover { | ||
52 | opacity: 1; | ||
53 | background: @noti-bg-darker | ||
54 | } | ||
55 | |||
56 | .notification-row { | ||
57 | outline: none; | ||
58 | margin: 5px; | ||
59 | padding: 0; | ||
60 | } | ||
61 | |||
62 | .notification { | ||
63 | background: @noti-bg; | ||
64 | margin: 0px; | ||
65 | border-radius: 5px; | ||
66 | border: 2px solid @border-color; | ||
67 | box-shadow: none; | ||
68 | } | ||
69 | |||
70 | .floating-notifications .notification { | ||
71 | border-color: @dominant; | ||
72 | } | ||
73 | |||
74 | .close-button { | ||
75 | border: none; | ||
76 | background: @dimDominant; | ||
77 | color: @cc-bg; | ||
78 | padding: 0; | ||
79 | margin: 5px 3px; | ||
80 | } | ||
81 | |||
82 | .close-button:hover { | ||
83 | box-shadow: none; | ||
84 | text-shadow: none; | ||
85 | } | ||
86 | |||
87 | .notification-content { | ||
88 | background: @cc-bg; | ||
89 | border-radius: 5px 5px 0 0; | ||
90 | padding: 7px; | ||
91 | margin: 0; | ||
92 | } | ||
93 | |||
94 | .notification-default-action:last-child .notification-content { | ||
95 | border-bottom-left-radius: 5px; | ||
96 | border-bottom-right-radius: 5px; | ||
97 | } | ||
98 | |||
99 | .notification-content .summary { | ||
100 | padding: 3px 1em; | ||
101 | font-size: 13px; | ||
102 | /*color: @text-color;*/ | ||
103 | } | ||
104 | |||
105 | .notification-content .body { | ||
106 | padding: 1em; | ||
107 | font-size: 12px; | ||
108 | font-weight: normal; | ||
109 | } | ||
110 | |||
111 | .notification-content .time { | ||
112 | font-size: 11px; | ||
113 | color: @dominant; | ||
114 | margin: 3px 3em; | ||
115 | } | ||
116 | |||
117 | .notification-action { | ||
118 | background-color: @noti-bg-darker; | ||
119 | border-radius: 0; | ||
120 | border: none; | ||
121 | border-top: 2px solid @border-color; | ||
122 | border-left: 1px solid @border-color; | ||
123 | border-right: 1px solid @border-color; | ||
124 | } | ||
125 | |||
126 | .notification-action:first-child { | ||
127 | border-left: none; | ||
128 | border-bottom-left-radius: 5px; | ||
129 | } | ||
130 | |||
131 | .notification-action:last-child { | ||
132 | border-right: none; | ||
133 | border-bottom-right-radius: 5px; | ||
134 | } | ||
135 | |||
136 | .notification-default-action:hover, | ||
137 | .notification-action:hover { | ||
138 | background: @dominant; | ||
139 | text-shadow: none; | ||
140 | } | ||
141 | |||
142 | .control-center { | ||
143 | background: @cc-bg; | ||
144 | border: 2px solid @dominant; | ||
145 | border-radius: 0px; | ||
146 | } | ||
147 | |||
148 | .control-center-list { | ||
149 | background: transparent | ||
150 | } | ||
151 | |||
152 | .control-center-list-placeholder { | ||
153 | opacity: .5 | ||
154 | } | ||
155 | |||
156 | .floating-notifications { | ||
157 | background: transparent | ||
158 | } | ||
159 | |||
160 | .blank-window { | ||
161 | background: alpha(black, 0.1) | ||
162 | } | ||
163 | |||
164 | .widget-backlight, | ||
165 | .widget-buttons-grid, | ||
166 | .widget-dnd, | ||
167 | .widget-inhibitors, | ||
168 | .widget-label, | ||
169 | .widget-menubar, | ||
170 | .widget-mpris, | ||
171 | .widget-notifications, | ||
172 | .widget-title, | ||
173 | .widget-volume { | ||
174 | color: @text-color; | ||
175 | background: @noti-bg-darker; | ||
176 | border: 2px solid @border-color; | ||
177 | border-radius: 5px; | ||
178 | padding: 5px 10px; | ||
179 | margin: 10px; | ||
180 | } | ||
181 | |||
182 | .widget-title { | ||
183 | font-size: 1.5rem; | ||
184 | } | ||
185 | |||
186 | .widget-dnd { | ||
187 | font-size: large; | ||
188 | color: @text-color; | ||
189 | } | ||
190 | |||
191 | .widget-dnd>switch { | ||
192 | /*border-radius: 4px;*/ | ||
193 | background: @darker-bg; | ||
194 | } | ||
195 | |||
196 | .widget-dnd>switch:checked { | ||
197 | background: @dominant; | ||
198 | } | ||
199 | |||
200 | .widget-dnd>switch slider { | ||
201 | /*margin: 3px;*/ | ||
202 | background: @border-color; | ||
203 | /*border: 1px solid black;*/ | ||
204 | /*border-radius: 5px*/ | ||
205 | } | ||
206 | |||
207 | .widget-dnd>switch:checked slider { | ||
208 | /*border-radius: 5px;*/ | ||
209 | } | ||
210 | |||
211 | .widget-label>label { | ||
212 | font-size: 1rem; | ||
213 | color: @text-color; | ||
214 | } | ||
215 | |||
216 | .widget-mpris > box > button { | ||
217 | border-radius: 5px; | ||
218 | } | ||
219 | |||
220 | .widget-mpris-player { | ||
221 | padding: 10px 20px; | ||
222 | margin: 22px; | ||
223 | box-shadow: none; | ||
224 | } | ||
225 | |||
226 | .widget-mpris-title { | ||
227 | font-weight: 700; | ||
228 | font-size: 1.25rem | ||
229 | } | ||
230 | |||
231 | .widget-mpris-subtitle { | ||
232 | font-size: 1.1rem | ||
233 | } | ||
234 | |||
235 | .widget-buttons-grid button label { | ||
236 | font-size: 1.5em; | ||
237 | } | ||
238 | |||
239 | .widget-buttons-grid>flowbox>flowboxchild>button { | ||
240 | margin: 3px; | ||
241 | } | ||
242 | |||
243 | .widget-menubar>box>.menu-button-bar>button { | ||
244 | border: none; | ||
245 | background: transparent; | ||
246 | box-shadow: none; | ||
247 | text-shadow: none; | ||
248 | } | ||
249 | |||
250 | .topbar-buttons>button { | ||
251 | border: none; | ||
252 | background: transparent | ||
253 | } | ||
254 | |||
255 | scale trough highlight { | ||
256 | background-color: @dominant; | ||
257 | } | ||
diff --git a/usecases/desktop/graphical/waybar.nix b/usecases/desktop/graphical/waybar.nix index 15868fe..bad1e09 100644 --- a/usecases/desktop/graphical/waybar.nix +++ b/usecases/desktop/graphical/waybar.nix | |||
@@ -17,7 +17,7 @@ inputs: | |||
17 | modules-left = [ "sway/workspaces" "sway/mode" ]; | 17 | modules-left = [ "sway/workspaces" "sway/mode" ]; |
18 | modules-center = lib.mkIf config.services.mpd.enable [ "mpd" ]; | 18 | modules-center = lib.mkIf config.services.mpd.enable [ "mpd" ]; |
19 | modules-right = [ | 19 | modules-right = [ |
20 | "idle_inhibitor" | 20 | "custom/notification" |
21 | "pulseaudio" | 21 | "pulseaudio" |
22 | "network#eth" | 22 | "network#eth" |
23 | "network#wlan" | 23 | "network#wlan" |
@@ -59,26 +59,26 @@ inputs: | |||
59 | }; | 59 | }; |
60 | }; | 60 | }; |
61 | 61 | ||
62 | idle_inhibitor = { | 62 | "custom/notification" = let |
63 | swaync-client = "${lib.getBin config.home-manager.users.minijackson.services.swaync.package}/bin/swaync-client"; | ||
64 | in { | ||
63 | format = "{icon}"; | 65 | format = "{icon}"; |
64 | format-icons = { | 66 | format-icons = { |
65 | activated = ""; | 67 | notification = "<span foreground='red'><sup></sup></span>"; |
66 | deactivated = ""; | 68 | none = ""; |
69 | dnd-notification = "<span foreground='red'><sup></sup></span>"; | ||
70 | dnd-none = ""; | ||
71 | inhibited-notification = "<span foreground='red'><sup></sup></span>"; | ||
72 | inhibited-none = ""; | ||
73 | dnd-inhibited-notification = "<span foreground='red'><sup></sup></span>"; | ||
74 | dnd-inhibited-none = ""; | ||
67 | }; | 75 | }; |
68 | on-click = let | 76 | tooltip = false; |
69 | script = pkgs.writeShellApplication { | 77 | return-type = "json"; |
70 | name = "switch-idle-mode"; | 78 | exec = "${swaync-client} -swb"; |
71 | runtimeInputs = [pkgs.mako pkgs.gnugrep]; | 79 | on-click = "${swaync-client} -t -sw"; |
72 | text = '' | 80 | on-click-right = "${swaync-client} -d -sw"; |
73 | if makoctl mode | grep -q do-not-disturb; then | 81 | escape = true; |
74 | makoctl mode -r do-not-disturb | ||
75 | else | ||
76 | makoctl mode -a do-not-disturb | ||
77 | fi | ||
78 | ''; | ||
79 | }; | ||
80 | in | ||
81 | lib.getExe script; | ||
82 | }; | 82 | }; |
83 | 83 | ||
84 | clock = { | 84 | clock = { |
@@ -176,7 +176,7 @@ inputs: | |||
176 | border-bottom: 3px solid ${foreground}; | 176 | border-bottom: 3px solid ${foreground}; |
177 | } | 177 | } |
178 | 178 | ||
179 | #clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-mpd, #mpd, #tray, #mode, #idle_inhibitor { | 179 | #clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-mpd, #mpd, #tray, #mode, #custom-notification { |
180 | padding: 0 10px; | 180 | padding: 0 10px; |
181 | margin: 0 5px; | 181 | margin: 0 5px; |
182 | } | 182 | } |
@@ -263,7 +263,7 @@ inputs: | |||
263 | background-color: #2980b9; | 263 | background-color: #2980b9; |
264 | } | 264 | } |
265 | 265 | ||
266 | #idle_inhibitor { | 266 | #custom-notification { |
267 | background-color: ${lightBackground}; | 267 | background-color: ${lightBackground}; |
268 | } | 268 | } |
269 | 269 | ||