blob: dab9164a97283325c46e5779e41297b0b775c38b [file] [log] [blame]
Skyler Grey252927a2022-10-18 22:18:15 +01001{ pkgs, ... }: {
Skyler Greya124e5f2022-08-26 06:49:46 +01002 home = {
3 programs.waybar = {
4 enable = true;
5 settings = [
6 {
Skyler Grey252927a2022-10-18 22:18:15 +01007 modules-left = [ "sway/workspaces" ];
Skyler Greya124e5f2022-08-26 06:49:46 +01008
Skyler Grey252927a2022-10-18 22:18:15 +01009 modules-center = [ "sway/window" ];
Skyler Greya124e5f2022-08-26 06:49:46 +010010
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}%";
Skyler Grey167be132022-09-04 11:38:58 +010061 format-plugged = "🔌 {capacity}%";
62 format-full-full = "🔌 Full";
Skyler Greya124e5f2022-08-26 06:49:46 +010063 format-icons = {
64 full = "🔋";
65 warning = "đŸĒĢ";
66 critical = "đŸĒĢ";
67 };
68 };
69 "sway/window" = {
70 max-length = 50;
71 };
72 clock = {
73 format = "⏰ {:%T}";
74 interval = 1;
75 };
76 "custom/notification" = {
77 tooltip = false;
78 format = "{icon}";
79 format-icons = {
80 notification = "🔔<sup><span color='#dd2e41'>●</span></sup>";
81 none = "🔔";
82 dnd-notification = "🔕<sup><span color='#dd2e41'>●</span></sup>";
83 dnd-none = "🔕";
84 };
85 "return-type" = "json";
86 "exec-if" = "which ${pkgs.swaynotificationcenter}/bin/swaync-client";
87 "exec" = "${pkgs.swaynotificationcenter}/bin/swaync-client -swb";
88 on-click = "${pkgs.swaynotificationcenter}/bin/swaync-client -t -sw";
89 on-click-right = "${pkgs.swaynotificationcenter}/bin/swaync-client -d -sw";
90 escape = true;
91 };
92 "custom/coffee" = {
93 tooltip = false;
94 format = "{icon}";
95 format-icons = {
96 none = "😴";
97 inhibiting = "☕";
98 };
99 "return-type" = "json";
Skyler Grey52e7adc2022-10-31 00:15:48 +0000100 "exec" = "while sleep 0.1; do ${pkgs.systemd}/bin/systemd-inhibit --list | grep idle | wc -l | jq '{alt: (if . == 0 then \"none\" else \"inhibiting\" end)} | tostring' -r; done";
Skyler Greya124e5f2022-08-26 06:49:46 +0100101 on-click = ./systemd-inhibit/stop-inhibiting-idle.sh;
102 on-click-right = ./systemd-inhibit/inhibit-idle.sh;
103 escape = true;
104 };
105 }
106 ];
107 style = builtins.readFile ./waybar/main.css;
108 };
109
110 wayland.windowManager.sway.config.startup = [
111 {
112 command = "\"pkill swaync; pkill waybar; ${pkgs.swaynotificationcenter}/bin/swaync & waybar\"";
113 always = true;
114 }
115 ];
Skyler Grey252927a2022-10-18 22:18:15 +0100116 home.packages = with pkgs; [ libappindicator swaynotificationcenter ];
Skyler Greya124e5f2022-08-26 06:49:46 +0100117 };
118}