summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usecases/desktop/graphical.nix2
-rw-r--r--usecases/desktop/graphical/sway.nix1
-rw-r--r--usecases/desktop/graphical/waybar.nix641
3 files changed, 338 insertions, 306 deletions
diff --git a/usecases/desktop/graphical.nix b/usecases/desktop/graphical.nix
index 787c455..f038b06 100644
--- a/usecases/desktop/graphical.nix
+++ b/usecases/desktop/graphical.nix
@@ -15,7 +15,7 @@ inputs: {
15 (import ./graphical/sway.nix inputs) 15 (import ./graphical/sway.nix inputs)
16 ./graphical/swaylock.nix 16 ./graphical/swaylock.nix
17 ./graphical/swaync.nix 17 ./graphical/swaync.nix
18 (import ./graphical/waybar.nix inputs) 18 ./graphical/waybar.nix
19 ./graphical/wlsunset.nix 19 ./graphical/wlsunset.nix
20 (import ./graphical/zathura.nix inputs) 20 (import ./graphical/zathura.nix inputs)
21 ]; 21 ];
diff --git a/usecases/desktop/graphical/sway.nix b/usecases/desktop/graphical/sway.nix
index 34dc978..e5aec69 100644
--- a/usecases/desktop/graphical/sway.nix
+++ b/usecases/desktop/graphical/sway.nix
@@ -10,6 +10,7 @@ _inputs:
10 greetd.enable = true; 10 greetd.enable = true;
11 swaylock.enable = true; 11 swaylock.enable = true;
12 swaync.enable = true; 12 swaync.enable = true;
13 waybar.enable = true;
13 wlsunset.enable = true; 14 wlsunset.enable = true;
14 }; 15 };
15 16
diff --git a/usecases/desktop/graphical/waybar.nix b/usecases/desktop/graphical/waybar.nix
index 6e6620c..4fdb68a 100644
--- a/usecases/desktop/graphical/waybar.nix
+++ b/usecases/desktop/graphical/waybar.nix
@@ -1,311 +1,342 @@
1inputs:
2
3{ config, lib, pkgs, ... }:
4
5{ 1{
6 home-manager.users.minijackson = { 2 config,
7 programs.waybar = { 3 lib,
8 enable = true; 4 pkgs,
9 5 ...
10 settings = [{ 6}:
11 layer = "top"; 7
12 position = "bottom"; 8let
13 height = 25; 9 cfg = config.reborn.waybar;
14 10in
15 gtk-layer-shell = true; 11{
16 12 options.reborn.waybar = {
17 modules-left = [ "sway/workspaces" "sway/mode" ]; 13 enable = lib.mkEnableOption "Reborn waybar config";
18 modules-center = lib.mkIf config.services.mpd.enable [ "mpd" ]; 14 };
19 modules-right = [
20 "custom/notification"
21 "pulseaudio"
22 "network#eth"
23 "network#wlan"
24 "cpu"
25 "memory"
26 "temperature"
27 "backlight"
28 "battery"
29 "clock"
30 "tray"
31 ];
32 15
33 mpd = lib.mkIf config.services.mpd.enable { 16 config = lib.mkIf cfg.enable {
34 format = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) <span font_desc='Font Awesome 5 Free'></span>"; 17 home-manager.users.minijackson = {
35 format-stopped = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped <span font_desc='Font Awesome 5 Free'></span>"; 18 programs.waybar = {
36 format-disconnected = "Disconnected <span font_desc='Font Awesome 5 Free'></span>"; 19 enable = true;
37 20
38 on-click-middle = "${pkgs.alacritty}/bin/alacritty --command ncmpcpp"; 21 settings = [
39 22 {
40 consume-icons = { 23 layer = "top";
41 on = " "; 24 position = "bottom";
42 }; 25 height = 25;
43 26
44 random-icons = { 27 gtk-layer-shell = true;
45 on = " "; 28
46 }; 29 modules-left = [
47 30 "sway/workspaces"
48 repeat-icons = { 31 "sway/mode"
49 on = " "; 32 ];
50 }; 33 modules-center = lib.mkIf config.services.mpd.enable [ "mpd" ];
51 34 modules-right = [
52 single-icons = { 35 "custom/notification"
53 on = "1 "; 36 "pulseaudio"
54 }; 37 "network#eth"
55 38 "network#wlan"
56 state-icons = { 39 "cpu"
57 playing = ""; 40 "memory"
58 paused = ""; 41 "temperature"
59 }; 42 "backlight"
60 }; 43 "battery"
61 44 "clock"
62 "custom/notification" = let 45 "tray"
63 swaync-client = "${lib.getBin config.home-manager.users.minijackson.services.swaync.package}/bin/swaync-client"; 46 ];
64 in { 47
65 format = "{icon}"; 48 mpd = lib.mkIf config.services.mpd.enable {
66 format-icons = { 49 format = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) <span font_desc='Font Awesome 5 Free'></span>";
67 notification = "󰂜<span foreground='red'><sup></sup></span>"; 50 format-stopped = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped <span font_desc='Font Awesome 5 Free'></span>";
68 none = "󰂜"; 51 format-disconnected = "Disconnected <span font_desc='Font Awesome 5 Free'></span>";
69 dnd-notification = "󰪑<span foreground='red'><sup></sup></span>"; 52
70 dnd-none = "󰪑"; 53 on-click-middle = "${pkgs.alacritty}/bin/alacritty --command ncmpcpp";
71 inhibited-notification = "󰂜<span foreground='red'><sup></sup></span>"; 54
72 inhibited-none = "󰂜"; 55 consume-icons = {
73 dnd-inhibited-notification = "󰪑<span foreground='red'><sup></sup></span>"; 56 on = " ";
74 dnd-inhibited-none = "󰪑"; 57 };
75 }; 58
76 tooltip = false; 59 random-icons = {
77 return-type = "json"; 60 on = " ";
78 exec = "${swaync-client} -swb"; 61 };
79 on-click = "${swaync-client} -t -sw"; 62
80 on-click-right = "${swaync-client} -d -sw"; 63 repeat-icons = {
81 escape = true; 64 on = " ";
82 }; 65 };
83 66
84 clock = { 67 single-icons = {
85 tooltip-format = "{:%Y-%m-%d | %H:%M}"; 68 on = "1 ";
86 format-alt = "{:%Y-%m-%d}"; 69 };
87 }; 70
88 71 state-icons = {
89 cpu = { format = "{usage}% "; }; 72 playing = "";
90 73 paused = "";
91 memory = { format = "{}% "; }; 74 };
92 75 };
93 battery = { 76
94 states = { good = 90; }; 77 "custom/notification" =
95 format = "{capacity}% {icon}"; 78 let
96 format-icons = [ 79 swaync-client = "${lib.getBin config.home-manager.users.minijackson.services.swaync.package}/bin/swaync-client";
97 "<span font_desc='Font Awesome 5 Free'></span>" 80 in
98 "<span font_desc='Font Awesome 5 Free'></span>" 81 {
99 "<span font_desc='Font Awesome 5 Free'></span>" 82 format = "{icon}";
100 "<span font_desc='Font Awesome 5 Free'></span>" 83 format-icons = {
101 "<span font_desc='Font Awesome 5 Free'></span>" 84 notification = "󰂜<span foreground='red'><sup></sup></span>";
102 ]; 85 none = "󰂜";
103 }; 86 dnd-notification = "󰪑<span foreground='red'><sup></sup></span>";
104 87 dnd-none = "󰪑";
105 "network#eth" = { 88 inhibited-notification = "󰂜<span foreground='red'><sup></sup></span>";
106 interface = "enp*"; 89 inhibited-none = "󰂜";
107 format-ethernet = "{ipaddr}/{cidr} "; 90 dnd-inhibited-notification = "󰪑<span foreground='red'><sup></sup></span>";
108 format-disconnected = "Disconnected "; 91 dnd-inhibited-none = "󰪑";
109 }; 92 };
110 93 tooltip = false;
111 "network#wlan" = { 94 return-type = "json";
112 interface = "wlp*"; 95 exec = "${swaync-client} -swb";
113 format-wifi = "{essid} ({signalStrength}%) <span font_desc='Font Awesome 5 Free'></span>"; 96 on-click = "${swaync-client} -t -sw";
114 format-disconnected = "Disconnected <span font_desc='Font Awesome 5 Free'></span>"; 97 on-click-right = "${swaync-client} -d -sw";
115 tooltip = true; 98 escape = true;
116 tooltip-format-wifi = "{ipaddr}/{cidr}"; 99 };
117 }; 100
118 101 clock = {
119 temperature = { 102 tooltip-format = "{:%Y-%m-%d | %H:%M}";
120 hwmon-path = "/sys/class/hwmon/hwmon0/temp1_input"; 103 format-alt = "{:%Y-%m-%d}";
121 format = "{temperatureC} °C "; 104 };
122 }; 105
123 106 cpu = {
124 backlight = { 107 format = "{usage}% ";
125 format = "{percent}% <span font_desc='Font Awesome 5 Free'>{icon}</span>"; 108 };
126 format-icons = [ "" "" ]; 109
127 }; 110 memory = {
128 111 format = "{}% ";
129 pulseaudio = { 112 };
130 format = "{volume}% {icon}"; 113
131 format-bluetooth = "{volume}% {icon}"; 114 battery = {
132 format-muted = ""; 115 states = {
133 format-icons = { 116 good = 90;
134 headphones = ""; 117 };
135 handsfree = ""; 118 format = "{capacity}% {icon}";
136 headset = ""; 119 format-icons = [
137 phone = ""; 120 "<span font_desc='Font Awesome 5 Free'></span>"
138 portable = ""; 121 "<span font_desc='Font Awesome 5 Free'></span>"
139 car = ""; 122 "<span font_desc='Font Awesome 5 Free'></span>"
140 default = [ "" "" ]; 123 "<span font_desc='Font Awesome 5 Free'></span>"
141 }; 124 "<span font_desc='Font Awesome 5 Free'></span>"
142 on-click = "pavucontrol"; 125 ];
143 }; 126 };
144 }]; 127
145 128 "network#eth" = {
146 style = with config.theme.colors; '' 129 interface = "enp*";
147 * { 130 format-ethernet = "{ipaddr}/{cidr} ";
148 border: none; 131 format-disconnected = "Disconnected ";
149 border-radius: 0; 132 };
150 font-family: mono; 133
151 font-size: 11px; 134 "network#wlan" = {
152 min-height: 0; 135 interface = "wlp*";
153 } 136 format-wifi = "{essid} ({signalStrength}%) <span font_desc='Font Awesome 5 Free'></span>";
154 137 format-disconnected = "Disconnected <span font_desc='Font Awesome 5 Free'></span>";
155 window#waybar { 138 tooltip = true;
156 background: ${background}; 139 tooltip-format-wifi = "{ipaddr}/{cidr}";
157 border-bottom: 3px solid ${lightBackground}; 140 };
158 color: ${foreground}; 141
159 } 142 temperature = {
160 143 hwmon-path = "/sys/class/hwmon/hwmon0/temp1_input";
161 /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ 144 format = "{temperatureC} °C ";
162 #workspaces button { 145 };
163 padding: 0 5px; 146
164 background: transparent; 147 backlight = {
165 color: ${foreground}; 148 format = "{percent}% <span font_desc='Font Awesome 5 Free'>{icon}</span>";
166 border-bottom: 3px solid transparent; 149 format-icons = [
167 } 150 ""
168 151 ""
169 #workspaces button.focused { 152 ];
170 background: ${dominant}; 153 };
171 border-bottom: 3px solid ${foreground}; 154
172 } 155 pulseaudio = {
173 156 format = "{volume}% {icon}";
174 #mode { 157 format-bluetooth = "{volume}% {icon}";
175 background: ${lightBackground}; 158 format-muted = "";
176 border-bottom: 3px solid ${foreground}; 159 format-icons = {
177 } 160 headphones = "";
178 161 handsfree = "";
179 #clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-mpd, #mpd, #tray, #mode, #custom-notification { 162 headset = "";
180 padding: 0 10px; 163 phone = "";
181 margin: 0 5px; 164 portable = "";
182 } 165 car = "";
183 166 default = [
184 #clock { 167 ""
185 background-color: ${neutralMagenta}; 168 ""
186 color: ${background}; 169 ];
187 } 170 };
188 171 on-click = "pavucontrol";
189 #battery { 172 };
190 background-color: ${neutralYellow}; 173 }
191 color: ${background}; 174 ];
192 }
193
194 /*
195 #battery.charging {
196 color: ${foreground};
197 background-color: #26A65B;
198 }
199 */
200
201 @keyframes blink {
202 to {
203 background-color: ${foreground};
204 color: ${background};
205 }
206 }
207
208 #battery.critical:not(.charging) {
209 background: ${fadedRed};
210 color: ${foreground};
211 animation-name: blink;
212 animation-duration: 0.5s;
213 animation-timing-function: linear;
214 animation-iteration-count: infinite;
215 animation-direction: alternate;
216 }
217
218 #cpu {
219 background: ${neutralOrange};
220 color: ${background};
221 }
222
223 #memory {
224 background: ${brightBlue};
225 color: ${background};
226 }
227
228 #backlight {
229 background: ${background6};
230 color: ${background};
231 }
232
233 #network {
234 background: ${neutralGreen};
235 color: ${background};
236 }
237
238 #network.disconnected {
239 background: ${lightBackground};
240 color: ${foreground};
241 }
242
243 #pulseaudio {
244 background: ${neutralCyan};
245 color: ${background};
246 }
247
248 #pulseaudio.muted {
249 background: ${foreground};
250 }
251
252 #temperature {
253 background: ${brightCyan};
254 color: ${background};
255 }
256
257 #temperature.critical {
258 background: ${fadedRed};
259 color: ${foreground};
260 }
261
262 #tray {
263 background-color: #2980b9;
264 }
265
266 #custom-notification {
267 color: ${background};
268 background-color: ${foreground};
269 }
270
271 #custom-notification.inhibited-notification,
272 #custom-notification.inhibited-none,
273 #custom-notification.dnd-inhibited-notification,
274 #custom-notification.dnd-inhibited-none {
275 color: ${foreground};
276 background-color: ${lightBackground};
277 }
278
279 #custom-mpd {
280 background-color: ${dominant};
281 }
282
283 #mpd {
284 background: ${dominant};
285 }
286
287 #mpd.disconnected {
288 background: ${lightBackground};
289 color: ${foreground};
290 }
291
292 #mpd.stopped {
293 background: ${foreground};
294 color: ${background};
295 }
296
297 #mpd.paused {
298 background: ${dimDominant};
299 }
300 '';
301
302 systemd.enable = true;
303 };
304 175
305 # Fix https://github.com/nix-community/home-manager/pull/1628 176 style = with config.theme.colors; ''
306 systemd.user.services.waybar.Unit = { 177 * {
307 Requisite = lib.mkForce []; 178 border: none;
308 After = lib.mkForce []; 179 border-radius: 0;
180 font-family: mono;
181 font-size: 11px;
182 min-height: 0;
183 }
184
185 window#waybar {
186 background: ${background};
187 border-bottom: 3px solid ${lightBackground};
188 color: ${foreground};
189 }
190
191 /* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
192 #workspaces button {
193 padding: 0 5px;
194 background: transparent;
195 color: ${foreground};
196 border-bottom: 3px solid transparent;
197 }
198
199 #workspaces button.focused {
200 background: ${dominant};
201 border-bottom: 3px solid ${foreground};
202 }
203
204 #mode {
205 background: ${lightBackground};
206 border-bottom: 3px solid ${foreground};
207 }
208
209 #clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-mpd, #mpd, #tray, #mode, #custom-notification {
210 padding: 0 10px;
211 margin: 0 5px;
212 }
213
214 #clock {
215 background-color: ${neutralMagenta};
216 color: ${background};
217 }
218
219 #battery {
220 background-color: ${neutralYellow};
221 color: ${background};
222 }
223
224 /*
225 #battery.charging {
226 color: ${foreground};
227 background-color: #26A65B;
228 }
229 */
230
231 @keyframes blink {
232 to {
233 background-color: ${foreground};
234 color: ${background};
235 }
236 }
237
238 #battery.critical:not(.charging) {
239 background: ${fadedRed};
240 color: ${foreground};
241 animation-name: blink;
242 animation-duration: 0.5s;
243 animation-timing-function: linear;
244 animation-iteration-count: infinite;
245 animation-direction: alternate;
246 }
247
248 #cpu {
249 background: ${neutralOrange};
250 color: ${background};
251 }
252
253 #memory {
254 background: ${brightBlue};
255 color: ${background};
256 }
257
258 #backlight {
259 background: ${background6};
260 color: ${background};
261 }
262
263 #network {
264 background: ${neutralGreen};
265 color: ${background};
266 }
267
268 #network.disconnected {
269 background: ${lightBackground};
270 color: ${foreground};
271 }
272
273 #pulseaudio {
274 background: ${neutralCyan};
275 color: ${background};
276 }
277
278 #pulseaudio.muted {
279 background: ${foreground};
280 }
281
282 #temperature {
283 background: ${brightCyan};
284 color: ${background};
285 }
286
287 #temperature.critical {
288 background: ${fadedRed};
289 color: ${foreground};
290 }
291
292 #tray {
293 background-color: #2980b9;
294 }
295
296 #custom-notification {
297 color: ${background};
298 background-color: ${foreground};
299 }
300
301 #custom-notification.inhibited-notification,
302 #custom-notification.inhibited-none,
303 #custom-notification.dnd-inhibited-notification,
304 #custom-notification.dnd-inhibited-none {
305 color: ${foreground};
306 background-color: ${lightBackground};
307 }
308
309 #custom-mpd {
310 background-color: ${dominant};
311 }
312
313 #mpd {
314 background: ${dominant};
315 }
316
317 #mpd.disconnected {
318 background: ${lightBackground};
319 color: ${foreground};
320 }
321
322 #mpd.stopped {
323 background: ${foreground};
324 color: ${background};
325 }
326
327 #mpd.paused {
328 background: ${dimDominant};
329 }
330 '';
331
332 systemd.enable = true;
333 };
334
335 # Fix https://github.com/nix-community/home-manager/pull/1628
336 systemd.user.services.waybar.Unit = {
337 Requisite = lib.mkForce [ ];
338 After = lib.mkForce [ ];
339 };
309 }; 340 };
310 }; 341 };
311} 342}