1{
2 pkgs,
3 lib,
4 config,
5 ...
6}:
7let
8 cfg = config.py.profiles.gui;
9 sway = config.wayland.windowManager.sway;
10in
11{
12 config = {
13 xdg.configFile."waybar/mocha.css" = lib.mkIf (cfg.enable && sway.enable) {
14 source = ./waybar-mocha.css;
15 recursive = false;
16 };
17 catppuccin.waybar.enable = false;
18 programs.waybar = lib.mkIf (cfg.enable && sway.enable) {
19 enable = lib.mkDefault false;
20 systemd.enable = true;
21 systemd.target = "sway-session.target";
22 style = ./waybar-style.css;
23 settings = {
24 mainBar = {
25 layer = "top";
26 position = "top";
27 height = 32;
28 modules-left = [
29 "sway/workspaces"
30 "sway/mode"
31 ];
32 modules-center = [ "mpris" ];
33 modules-right = [
34 "idle_inhibitor"
35 "wireplumber"
36 "network"
37 "temperature"
38 "backlight"
39 "battery"
40 "clock"
41 "tray"
42 ];
43 "sway/workspaces" = {
44 disable-scroll = true;
45 enable-bar-scroll = false;
46 active-only = false;
47 all-outputs = false;
48 format = "{icon}";
49 };
50 "idle_inhibitor" = {
51 format = "{icon} ";
52 format-icons = {
53 "activated" = "";
54 "deactivated" = "";
55 };
56 };
57 "tray" = {
58 icon-size = 25;
59 spacing = 12;
60 };
61 "clock" = {
62 tooltip-format = "<tt><small>{calendar}</small></tt>";
63 format = " {:%H:%M:%S}";
64 format-alt = "{%d %b %Y}";
65 interval = 1;
66 calendar = {
67 format = {
68 today = "<span color='#89b4fa'><b><u>{}</u></b></span>";
69 };
70 };
71 };
72 "cpu" = {
73 format = " {usage}%";
74 interval = 5;
75 tooltip = false;
76 };
77 "memory" = {
78 format = " {}%";
79 };
80 "temperature" = {
81 critical-threshold = 80;
82 format = "{icon} {temperatureC}°C";
83 format-icons = [
84 ""
85 ""
86 ""
87 ""
88 ""
89 ];
90 };
91 "backlight" = {
92 format = "{icon} {percent}%";
93 format-icons = [
94 ""
95 ""
96 ""
97 ""
98 ""
99 ""
100 ""
101 ];
102 };
103 "battery" = {
104 states = {
105 good = 65;
106 warning = 30;
107 critical = 15;
108 };
109 full-at = 80;
110 format = "{icon} {capacity}%";
111 format-charging = " {capacity}%";
112 format-plugged = " {capacity}%";
113 format-alt = "{icon} {time}";
114 format-icons = [
115 ""
116 ""
117 ""
118 ""
119 ""
120 ""
121 ""
122 ""
123 ""
124 ""
125 ""
126 ];
127 };
128 "network" = {
129 format-wifi = "<big></big> {essid}";
130 format-ethernet = " {ifname}: {ipaddr}/{cidr}";
131 format-linked = " {ifname} (No IP)";
132 format-disconnected = "⚠ Disconnected!";
133 format-alt = "{ifname}: {ipaddr}/{cidr}";
134 on-click = lib.getExe pkgs.networkmanagerapplet;
135 };
136 "wireplumber" = {
137 format = "{icon} {volume}%";
138 format-muted = "";
139 format-icons = [
140 ""
141 ""
142 ""
143 ];
144 states = {
145 low = 15;
146 med = 40;
147 high = 60;
148 };
149 scroll-step = 5;
150 on-click = lib.getExe pkgs.pwvucontrol;
151 };
152 mpris = {
153 format = "{status_icon} {dynamic}";
154 max-length = 100;
155 format-paused = "{status_icon} <i>{dynamic}</i>";
156 dynamic-order = [
157 "artist"
158 "title"
159 ];
160 status-icons = {
161 playing = "";
162 paused = "";
163 };
164 player-icons = {
165 firefox = "";
166 };
167 };
168 };
169 };
170 };
171 };
172}