blob: f40cc62b366cfa118f09a2aa1649393389cc8699 [file] [log] [blame]
Skyler Greya124e5f2022-08-26 06:49:46 +01001{pkgs, ...}: {
2 home = {
3 programs.waybar = {
4 enable = true;
5 settings = [
6 {
7 modules-left = ["sway/workspaces"];
8
9 modules-center = ["sway/window"];
10
11 modules-right = [
12 "backlight"
13 "pulseaudio"
14 "network"
15 "battery"
16 "clock"
17 "custom/coffee"
18 "custom/notification"
19 "tray"
20 ];
21
22 pulseaudio = {
23 format = "{icon} {volume}%";
24 format-tooltip = "{desc}";
25 format-muted = "🔇 Muted";
26 format-icons = [
27 "🔈"
28 "🔉"
29 "🔊"
30 ];
31 states.muted = 0;
32 };
33 backlight = {
34 format = "{icon} {percent}%";
35 on-scroll-up = "${pkgs.light}/bin/light -A 3";
36 on-scroll-down = "${pkgs.light}/bin/light -N 1 && ${pkgs.light}/bin/light -U 3";
37 format-icons = [
38 "🔅"
39 "🔆"
40 "☀ī¸"
41 "✨"
42 ];
43 };
44 network = {
45 format = "🔗 {ifname}";
46 format-wifi = "📡 {essid} ({ifname})";
47 format-disabled = "";
48 format-disconnected = "🌐 No network";
49 tooltip-format = "{ipaddr}/{cidr}";
50 tooltip-format-wifi = "{ipaddr}/{cidr} ({signalStrength}%)";
51 tooltip-format-disconnected = "Disconnected";
52 };
53 battery = {
54 states = {
55 full = 100;
56 warning = 30;
57 critical = 10;
58 };
59 format = "{icon} {capacity}%";
60 format-charging = "🔌 {capacity}%";
61 format-icons = {
62 full = "🔋";
63 warning = "đŸĒĢ";
64 critical = "đŸĒĢ";
65 };
66 };
67 "sway/window" = {
68 max-length = 50;
69 };
70 clock = {
71 format = "⏰ {:%T}";
72 interval = 1;
73 };
74 "custom/notification" = {
75 tooltip = false;
76 format = "{icon}";
77 format-icons = {
78 notification = "🔔<sup><span color='#dd2e41'>●</span></sup>";
79 none = "🔔";
80 dnd-notification = "🔕<sup><span color='#dd2e41'>●</span></sup>";
81 dnd-none = "🔕";
82 };
83 "return-type" = "json";
84 "exec-if" = "which ${pkgs.swaynotificationcenter}/bin/swaync-client";
85 "exec" = "${pkgs.swaynotificationcenter}/bin/swaync-client -swb";
86 on-click = "${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw";
87 on-click-right = "${pkgs.swaynotificationcenter}/bin/swaync-client -d -sw";
88 escape = true;
89 };
90 "custom/coffee" = {
91 tooltip = false;
92 format = "{icon}";
93 format-icons = {
94 none = "😴";
95 inhibiting = "☕";
96 };
97 "return-type" = "json";
98 "exec" = "while sleep 0.1; do ${pkgs.systemd}/bin/systemd-inhibit --list | wc -l | jq '{alt: (if . == 1 then \"none\" else \"inhibiting\" end)} | tostring' -r; done";
99 on-click = ./systemd-inhibit/stop-inhibiting-idle.sh;
100 on-click-right = ./systemd-inhibit/inhibit-idle.sh;
101 escape = true;
102 };
103 }
104 ];
105 style = builtins.readFile ./waybar/main.css;
106 };
107
108 wayland.windowManager.sway.config.startup = [
109 {
110 command = "\"pkill swaync; pkill waybar; ${pkgs.swaynotificationcenter}/bin/swaync & waybar\"";
111 always = true;
112 }
113 ];
114 home.packages = with pkgs; [libappindicator swaynotificationcenter];
115 };
116}