tangled
alpha
login
or
join now
dunkirk.sh
/
dots
3
fork
atom
Kieran's opinionated (and probably slightly dumb) nix config
3
fork
atom
overview
issues
pulls
pipelines
feat: allow hyprnix config to build
Kieran Klukas
2 years ago
0b01ad09
65642c46
+9
-763
5 changed files
expand all
collapse all
unified
split
home-manager
hyprland
config.nix
default.nix
keybinds.nix
waybar.nix
waybar.scss
+4
-62
home-manager/hyprland/config.nix
···
1
1
{ lib, ... }:
2
2
-
let
3
3
-
inherit (lib.birdos.colors) grayRGB;
4
4
-
hyprRGBA = rgb: a: "rgba(${lib.birdos.colors.hexRGBA rgb a})";
5
5
-
gb = (lib.birdos.colors.formats.custom hyprRGBA).gruvbox.dark;
6
6
-
shadow = hyprRGBA (grayRGB 6.0e-2); # 6% of each channel
7
7
-
in {
2
2
+
{
8
3
wayland.windowManager.hyprland = {
9
4
# <https://wiki.hyprland.org/Configuring/Variables/#general>
10
5
config.general = {
11
6
border_size = 2;
12
7
gaps_inside = 5;
13
8
gaps_outside = 10;
14
14
-
active_border_color = gb.fg3 1.0;
15
15
-
inactive_border_color = gb.bg3 1.0;
16
16
-
cursor_inactive_timeout = 10;
17
17
-
no_cursor_warps = true;
18
9
resize_on_border = true;
19
10
extend_border_grab_area = 10;
20
11
};
···
24
15
rounding = 0;
25
16
shadow_range = 8;
26
17
shadow_render_power = 2;
27
27
-
active_shadow_color = shadow 0.9;
28
28
-
inactive_shadow_color = shadow 0.6;
29
18
blur = {
30
19
size = 3; # 8
31
20
passes = 2; # 1
···
44
33
in {
45
34
follow_mouse = LOOSE;
46
35
float_switch_override_focus = DISABLED;
36
36
+
touchpad = {
37
37
+
natural_scroll = true;
38
38
+
};
47
39
};
48
40
49
41
# <https://wiki.hyprland.org/Configuring/Variables/#binds>
···
83
75
insert_after_current = true;
84
76
focus_removed_window = true;
85
77
86
86
-
active_border_color = gb.hl_yellow 1.0;
87
87
-
inactive_border_color = gb.bg3 1.0;
88
88
-
locked_active_border_color = gb.hl_blue 1.0;
89
89
-
locked_inactive_border_color = gb.bg3 1.0;
90
90
-
91
78
# These features are not polished yet:
92
79
# <https://github.com/hyprwm/Hyprland/issues/2415>
93
80
# @MightyPlaza is working on this, but not doing it how we expect.
···
97
84
gradients = false;
98
85
render_titles = true;
99
86
scrolling = true;
100
100
-
text_color = gb.fg0 1.0;
101
101
-
102
102
-
active_color = gb.fg3 1.0;
103
103
-
inactive_color = gb.bg1 0.6;
104
104
-
locked_active_color = active_color;
105
105
-
locked_inactive_color = inactive_color;
106
87
};
107
88
};
108
89
···
115
96
};
116
97
117
98
# <https://wiki.hyprland.org/Configuring/Animations/#curves>
118
118
-
animations.animation = {
119
119
-
# window creation
120
120
-
windowsIn = {
121
121
-
enable = true;
122
122
-
duration = 200;
123
123
-
curve = "easeOutCirc";
124
124
-
style = "popin 60%";
125
125
-
};
126
126
-
fadeIn = {
127
127
-
enable = true;
128
128
-
duration = 100;
129
129
-
curve = "easeOutCirc";
130
130
-
};
131
131
-
# window destruction
132
132
-
windowsOut = {
133
133
-
enable = true;
134
134
-
duration = 200;
135
135
-
curve = "easeOutCirc";
136
136
-
style = "popin 60%";
137
137
-
};
138
138
-
fadeOut = {
139
139
-
enable = true;
140
140
-
duration = 100;
141
141
-
curve = "easeOutCirc";
142
142
-
};
143
143
-
# window movement
144
144
-
windowsMove = {
145
145
-
enable = true;
146
146
-
duration = 300;
147
147
-
curve = "easeInOutCubic";
148
148
-
style = "popin";
149
149
-
};
150
150
-
workspaces = {
151
151
-
enable = true;
152
152
-
duration = 200;
153
153
-
curve = "easeOutCirc";
154
154
-
style = "slide";
155
155
-
};
156
156
-
};
157
99
};
158
100
}
+4
-23
home-manager/hyprland/default.nix
···
1
1
{ self, config, lib, pkgs, inputs, ... }: {
2
2
imports = [
3
3
inputs.hyprnix.homeManagerModules.hyprland
4
4
-
# inputs.hyprland-nix.homeManagerModules.xdg-desktop-portals
5
5
-
#./config.nix
6
6
-
#./windowrules.nix
7
7
-
#./keybinds.nix
8
8
-
#./waybar.nix
4
4
+
./config.nix
5
5
+
./windowrules.nix
6
6
+
./keybinds.nix
7
7
+
../waybar.nix
9
8
];
10
9
11
10
wayland.windowManager.hyprland = {
···
26
25
"${lib.getExe pkgs.xorg.xhost} +local:"
27
26
];
28
27
};
29
29
-
30
30
-
# xdg.desktopPortals = {
31
31
-
# enable = true;
32
32
-
# extraPortals = [
33
33
-
# pkgs.xdg-desktop-portal-hyprland
34
34
-
# pkgs.xdg-desktop-portal-kde
35
35
-
# pkgs.xdg-desktop-portal-gtk
36
36
-
# ];
37
37
-
# configPackages = [ config.wayland.windowManager.hyprland.package ];
38
38
-
# config = {
39
39
-
# x-cinnamon = { default = [ "xapp" "gtk" ]; };
40
40
-
# pantheon = {
41
41
-
# default = [ "pantheon" "gtk" ];
42
42
-
# "org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ];
43
43
-
# };
44
44
-
# common = { default = [ "gtk" ]; };
45
45
-
# };
46
46
-
# };
47
28
}
+1
-58
home-manager/hyprland/keybinds.nix
···
11
11
MOUSE_EX1 = "mouse:275";
12
12
MOUSE_EX2 = "mouse:276";
13
13
14
14
-
exec = {
15
15
-
screenshotWindow = pkgs.patchShellScript ./scripts/screenshot.sh {
16
16
-
runtimeInputs = with pkgs; [
17
17
-
jq
18
18
-
grim
19
19
-
wl-clipboard
20
20
-
libnotify
21
21
-
config.wayland.windowManager.hyprland.package
22
22
-
];
23
23
-
};
24
24
-
playerctl = lib.getExe pkgs.playerctl;
25
25
-
slight = lib.getExe pkgs.slight;
26
26
-
osdFunc = lib.getExe config.utilities.osd-functions.package;
27
27
-
airplaneMode = "sudo /run/current-system/sw/bin/airplane-mode";
28
28
-
toggleGroupOrLock =
29
29
-
pkgs.patchShellScript ./scripts/toggle-group-or-lock.sh {
30
30
-
runtimeInputs = with pkgs; [
31
31
-
jq
32
32
-
config.wayland.windowManager.hyprland.package
33
33
-
];
34
34
-
};
35
35
-
};
36
36
-
37
14
# Collections of keybinds common across multiple submaps are collected into
38
15
# groups, which can be merged together granularly.
39
16
groups = {
···
47
24
launchPrograms = {
48
25
# Launch the program with a shortcut.
49
26
bind."SUPER, E" = "exec, dolphin";
50
50
-
bind."SUPER, Enter" = "exec, alacritty";
27
27
+
bind."SUPER, Enter" = "exec, foot";
51
28
};
52
29
53
30
# Kill the active window.
···
217
194
# Forcefully kill a program after selecting its window with the mouse.
218
195
bind."SUPER_SHIFT, Q" = "exec, hyprctl kill";
219
196
220
220
-
# Screenshot the currently focused window and copy to clipboard.
221
221
-
bind."SUPER, print" = "exec, ${exec.screenshotWindow}";
222
222
-
223
197
# Select a region and take a screenshot, saving to the clipboard.
224
198
bind."SUPER_SHIFT, print" = "exec, prtsc -c -m r -D -b 00000066";
225
199
···
235
209
bind."SUPER, Space" = "exec, rofi -show drun -show-icons";
236
210
# Open Rofi to run a command.
237
211
bind."SUPER, R" = "exec, rofi -show run";
238
238
-
}
239
239
-
### FUNCTION KEYS ###
240
240
-
{
241
241
-
# The names of these keys can be found at:
242
242
-
# <https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h>
243
243
-
244
244
-
bindl."SHIFT, XF86WLAN" = "exec, ${exec.airplaneMode}";
245
245
-
246
246
-
# Mute/unmute the active audio output.
247
247
-
bindl.", XF86AudioMute" = "exec, ${exec.osdFunc} output mute";
248
248
-
249
249
-
# Raise and lower the volume of the active audio output.
250
250
-
bindel.", XF86AudioRaiseVolume" = "exec, ${exec.osdFunc} output +0.05";
251
251
-
bindel.", XF86AudioLowerVolume" = "exec, ${exec.osdFunc} output -0.05";
252
252
-
253
253
-
# Mute the active microphone or audio source.
254
254
-
bindl.", XF86AudioMicMute" = "exec, ${exec.osdFunc} input mute";
255
255
-
256
256
-
# Raise and lower display brightness.
257
257
-
bindel.", XF86MonBrightnessUp" = "exec, ${exec.slight} inc 10 -t 300ms";
258
258
-
bindel.", XF86MonBrightnessDown" = "exec, ${exec.slight} dec 10 -t 300ms";
259
259
-
260
260
-
# Regular media control keys, if your laptop or bluetooth device has them.
261
261
-
bindl.", XF86AudioPlay" = "exec, ${exec.playerctl} play-pause";
262
262
-
bindl.", XF86AudioPrev" = "exec, ${exec.playerctl} previous";
263
263
-
bindl.", XF86AudioNext" = "exec, ${exec.playerctl} next";
264
264
-
265
265
-
# Poor-man's media player control keys.
266
266
-
bindl."SUPER, slash" = "exec, ${exec.playerctl} play-pause";
267
267
-
bindl."SUPER, comma" = "exec, ${exec.playerctl} previous";
268
268
-
bindl."SUPER, period" = "exec, ${exec.playerctl} next";
269
212
}
270
213
### WINDOW FOCUS & MOVEMENT ###
271
214
groups.moveFocusOrWindow
-384
home-manager/hyprland/waybar.nix
···
1
1
-
{ config, lib, pkgs, ... }:
2
2
-
let
3
3
-
package = pkgs.waybar;
4
4
-
5
5
-
# the fonts that will be included with the waybar package
6
6
-
fontPackages = [ pkgs.ubuntu_font_family pkgs.material-design-icons ];
7
7
-
8
8
-
# patch those fonts in
9
9
-
package' = let super = package;
10
10
-
in pkgs.symlinkJoin {
11
11
-
inherit (super) name pname version meta;
12
12
-
paths = [ super ] ++ fontPackages;
13
13
-
};
14
14
-
15
15
-
compileSCSS = name: source:
16
16
-
"${
17
17
-
pkgs.runCommandLocal name { } ''
18
18
-
mkdir -p $out
19
19
-
${lib.getExe pkgs.sassc} -t expanded '${source}' > $out/${name}.css
20
20
-
''
21
21
-
}/${name}.css";
22
22
-
23
23
-
# TODO when using store paths to executables, they do not inherit the user's
24
24
-
# environment (at least with systemd) and therefore GUIs use the default theme
25
25
-
commands = let
26
26
-
slight = "${lib.getExe pkgs.slight}";
27
27
-
hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl";
28
28
-
# TODO this is duplicated from the hyprland config, make it a module
29
29
-
kbFns = lib.getExe config.utilities.osd-functions.package;
30
30
-
pavucontrol = lib.getExe pkgs.lxqt.pavucontrol-qt;
31
31
-
blueman-manager = "${pkgs.blueman}/bin/blueman-manager";
32
32
-
bluetoothctl = "${pkgs.bluez}/bin/bluetoothctl";
33
33
-
systemctl = "${pkgs.systemd}/bin/systemctl";
34
34
-
iwgtk = lib.getExe pkgs.iwgtk;
35
35
-
in {
36
36
-
backlightUp = "${slight} inc 5% -t 150ms";
37
37
-
backlightDown = "${slight} dec 5% -t 150ms";
38
38
-
# TODO --tab no longer works, what is the identifier to use?
39
39
-
outputSoundSettings = "${pavucontrol} --tab 'Output Devices'";
40
40
-
outputVolumeMute = "${kbFns} output mute";
41
41
-
outputVolumeUp = "${kbFns} output +0.05";
42
42
-
outputVolumeDown = "${kbFns} output -0.05";
43
43
-
# TODO --tab no longer works, what is the identifier to use?
44
44
-
inputSoundSettings = "${pavucontrol} --tab 'Input Devices'";
45
45
-
inputVolumeMute = "${kbFns} input mute";
46
46
-
# inputVolumeUp = "${kbFns} input +0.05";
47
47
-
# inputVolumeDown = "${kbFns} input -0.05";
48
48
-
bluetoothSettings = (pkgs.writeShellScript "waybar-bluetooth-settings" ''
49
49
-
set -eux
50
50
-
export PATH="${
51
51
-
lib.makeBinPath
52
52
-
(with pkgs; [ coreutils gawk util-linux bluez nettools blueman ])
53
53
-
}:$PATH"
54
54
-
is_powered_on="$(
55
55
-
bluetoothctl show | \
56
56
-
awk '/Name: '"$(hostname)"'$/{p=1} p && /Powered: yes/{print "true"; exit} END{if(!NR || !p) print "false"}'
57
57
-
)"
58
58
-
if [[ $is_powered_on == 'true' ]]; then
59
59
-
blueman-manager
60
60
-
else
61
61
-
rfkill unblock bluetooth && sleep 1 || true
62
62
-
bluetoothctl power on
63
63
-
sleep 0.5
64
64
-
blueman-manager
65
65
-
fi
66
66
-
'').outPath;
67
67
-
bluetoothToggle = (pkgs.writeShellScript "waybar-bluetooth-toggle" ''
68
68
-
set -eux
69
69
-
export PATH="${
70
70
-
lib.makeBinPath
71
71
-
(with pkgs; [ coreutils gawk util-linux bluez nettools ])
72
72
-
}:$PATH"
73
73
-
is_powered_on="$(
74
74
-
bluetoothctl show | \
75
75
-
awk '/Name: '"$(hostname)"'$/{p=1} p && /Powered: yes/{print "true"; exit} END{if(!NR || !p) print "false"}'
76
76
-
)"
77
77
-
if [[ $is_powered_on == 'true' ]]; then
78
78
-
bluetoothctl power off
79
79
-
else
80
80
-
rfkill unblock bluetooth && sleep 1 || true
81
81
-
bluetoothctl power on
82
82
-
fi
83
83
-
'').outPath;
84
84
-
bluetoothKill =
85
85
-
"rfkill block bluetooth && ${systemctl} restart bluetooth.service";
86
86
-
bluetoothOff = "${bluetoothctl} power off";
87
87
-
wirelessSettings = iwgtk;
88
88
-
workspaceSwitchPrev = "${hyprctl} dispatch workspace m-1";
89
89
-
workspaceSwitchNext = "${hyprctl} dispatch workspace m+1";
90
90
-
};
91
91
-
in {
92
92
-
programs.waybar.enable = true;
93
93
-
programs.waybar.package = package';
94
94
-
95
95
-
programs.waybar.systemd.enable = true;
96
96
-
97
97
-
programs.waybar.style =
98
98
-
builtins.readFile (compileSCSS "waybar-style" ./waybar.scss);
99
99
-
100
100
-
programs.waybar.settings = {
101
101
-
mainBar = {
102
102
-
layer = "top";
103
103
-
position = "top";
104
104
-
# Causes tooltips to be shown behind windows.
105
105
-
# mode = "dock";
106
106
-
height = 26;
107
107
-
108
108
-
modules-left = [ # #
109
109
-
"clock#time"
110
110
-
"clock#date"
111
111
-
# "wlr/workspaces"
112
112
-
"tray"
113
113
-
"mpris"
114
114
-
];
115
115
-
116
116
-
modules-center = [ # #
117
117
-
"hyprland/workspaces"
118
118
-
];
119
119
-
120
120
-
modules-right = [
121
121
-
"hyprland/submap"
122
122
-
"pulseaudio#output"
123
123
-
"pulseaudio#input"
124
124
-
"backlight"
125
125
-
"memory"
126
126
-
"cpu"
127
127
-
"temperature"
128
128
-
"battery"
129
129
-
"network"
130
130
-
"bluetooth"
131
131
-
"idle_inhibitor"
132
132
-
];
133
133
-
134
134
-
## MODULES-LEFT ##
135
135
-
136
136
-
# Hyprland dropped support unfortunately.
137
137
-
138
138
-
# "wlr/workspaces" = {
139
139
-
# sort-by-number = true;
140
140
-
141
141
-
# on-click = "activate";
142
142
-
# on-scroll-up = commands.workspaceSwitchPrev;
143
143
-
# on-scroll-down = commands.workspaceSwitchNext;
144
144
-
# };
145
145
-
146
146
-
"hyprland/workspaces" = {
147
147
-
format = "{name}";
148
148
-
# sort-by-number = true;
149
149
-
150
150
-
# on-click = "activate";
151
151
-
on-scroll-up = commands.workspaceSwitchPrev;
152
152
-
on-scroll-down = commands.workspaceSwitchNext;
153
153
-
};
154
154
-
155
155
-
tray = {
156
156
-
show-passive-items = true;
157
157
-
icon-size = 12;
158
158
-
spacing = 16;
159
159
-
};
160
160
-
161
161
-
mpris = {
162
162
-
player = "playerctld";
163
163
-
interval = 1;
164
164
-
165
165
-
format = "{status_icon} {dynamic}";
166
166
-
dynamic-len = 70;
167
167
-
dynamic-separator = " — ";
168
168
-
dynamic-order = [ "title" "artist" "position" "length" ];
169
169
-
dynamic-importance = [ "position" "title" "artist" ];
170
170
-
status-icons = {
171
171
-
playing = "";
172
172
-
paused = "";
173
173
-
stopped = "";
174
174
-
};
175
175
-
176
176
-
tooltip-format = lib.trim ''
177
177
-
<b>Player:</b> {player} ({status})
178
178
-
<b>Title:</b> {title}
179
179
-
<b>Artist:</b> {artist}
180
180
-
<b>Album:</b> {album}
181
181
-
<b>Length:</b> {position}/{length}
182
182
-
'';
183
183
-
};
184
184
-
185
185
-
"hyprland/submap" = {
186
186
-
format = " {}";
187
187
-
tooltip = false;
188
188
-
};
189
189
-
190
190
-
"hyprland/window" = { max-length = 50; };
191
191
-
192
192
-
## MODULES-CENTER ##
193
193
-
194
194
-
"clock#time" = { format = "{:%I:%M %p}"; };
195
195
-
196
196
-
"clock#date" = { format = "{:%A, %B %d}"; };
197
197
-
198
198
-
## MODULES-RIGHT ##
199
199
-
200
200
-
"pulseaudio#output" = {
201
201
-
format = "{icon} {volume}%";
202
202
-
format-muted = " {volume}%";
203
203
-
format-icons = {
204
204
-
headphone = "";
205
205
-
# speaker = "";
206
206
-
hdmi = "";
207
207
-
headset = "";
208
208
-
# hands-free = "";
209
209
-
# portable = "";
210
210
-
# car = "";
211
211
-
# hifi = "";
212
212
-
# phone = "";
213
213
-
default = [ "" "" "" ];
214
214
-
};
215
215
-
216
216
-
# anything below 100% is "safe" volume levels,
217
217
-
# the default style will be used,
218
218
-
# anything higher than this will have no CSS class,
219
219
-
# that will be considered "warning" state
220
220
-
# `#pulseaudio.output:not(.safe)`
221
221
-
states = { safe = 100; };
222
222
-
223
223
-
ignored-sinks = [ "Easy Effects Sink" ];
224
224
-
225
225
-
on-click = commands.outputSoundSettings;
226
226
-
on-click-right = commands.outputVolumeMute;
227
227
-
on-scroll-up = commands.outputVolumeUp;
228
228
-
on-scroll-down = commands.outputVolumeDown;
229
229
-
};
230
230
-
231
231
-
# TODO volume
232
232
-
"pulseaudio#input" = {
233
233
-
format = "{format_source}";
234
234
-
# format-source = " {volume}%";
235
235
-
# format-source-muted = " {volume}%";
236
236
-
format-source = "";
237
237
-
format-source-muted = "";
238
238
-
239
239
-
on-click = commands.inputSoundSettings;
240
240
-
on-click-right = commands.inputVolumeMute;
241
241
-
# on-scroll-up = commands.inputVolumeUp;
242
242
-
# on-scroll-down = commands.inputVolumeDown;
243
243
-
};
244
244
-
245
245
-
backlight = {
246
246
-
device = "amdgpu_bl0";
247
247
-
format = "{icon} {percent}%";
248
248
-
# format-icons = ["" "" "" "" ""];
249
249
-
format-icons = [ "" "" "" "" "" "" "" "" "" "" ];
250
250
-
251
251
-
on-scroll-up = commands.backlightUp;
252
252
-
on-scroll-down = commands.backlightDown;
253
253
-
};
254
254
-
255
255
-
memory = {
256
256
-
interval = 10;
257
257
-
format = " {used:.2g}/{total:.2g}GiB";
258
258
-
};
259
259
-
260
260
-
cpu = {
261
261
-
interval = 5;
262
262
-
format = " {usage}%";
263
263
-
};
264
264
-
265
265
-
temperature = {
266
266
-
interval = 5;
267
267
-
hwmon-path-abs = "/sys/devices/pci0000:00/0000:00:18.3/hwmon";
268
268
-
input-filename = "temp1_input";
269
269
-
critical-threshold =
270
270
-
90; # 15C lower than Tjmax <https://www.amd.com/en/product/9686>
271
271
-
format = "{icon} {temperatureC}°C";
272
272
-
format-critical = " {temperatureC}°C";
273
273
-
# 4x low, 2x mid, 3x high, for 0-90
274
274
-
format-icons = [ "" "" "" "" "" "" "" "" "" ];
275
275
-
};
276
276
-
277
277
-
network = let
278
278
-
tooltip = ''
279
279
-
<b>Address:</b> {ipaddr}
280
280
-
<b>Netmask:</b> {netmask}
281
281
-
<b>Gateway:</b> {gwaddr}
282
282
-
<b>Speeds:</b> {bandwidthUpBytes} UL, {bandwidthDownBytes} DL
283
283
-
'';
284
284
-
in {
285
285
-
format-ethernet = " {bandwidthDownBytes}";
286
286
-
format-wifi = "{icon} {bandwidthDownBytes}";
287
287
-
format-linked = " {bandwidthDownBytes}";
288
288
-
format-disconnected = "";
289
289
-
format-icons = [ "" "" "" "" ];
290
290
-
291
291
-
tooltip-format = lib.trim ''
292
292
-
<b>Interface</b>: {ifname}
293
293
-
${tooltip}
294
294
-
'';
295
295
-
tooltip-format-wifi = lib.trim ''
296
296
-
<b>SSID:</b> {essid}
297
297
-
<b>Strength:</b> {signaldBm} dBmW ({signalStrength}%)
298
298
-
<b>Frequency:</b> {frequency} GHz
299
299
-
${tooltip}
300
300
-
'';
301
301
-
tooltip-format-disconnected = "Network disconnected.";
302
302
-
303
303
-
on-click = commands.wirelessSettings;
304
304
-
};
305
305
-
306
306
-
bluetooth = {
307
307
-
controller = "C0:3C:59:02:25:C3";
308
308
-
format-on = "";
309
309
-
format-off = "";
310
310
-
format-disabled = "";
311
311
-
format-connected = " {num_connections}";
312
312
-
format-connected-battery =
313
313
-
" {device_alias} ({device_battery_percentage}%) ({num_connections})";
314
314
-
315
315
-
on-click = commands.bluetoothSettings;
316
316
-
on-click-middle = commands.bluetoothKill;
317
317
-
on-click-right = commands.bluetoothToggle;
318
318
-
};
319
319
-
320
320
-
battery = {
321
321
-
interval = 5;
322
322
-
bat = "BAT0";
323
323
-
# full-at = 94;
324
324
-
format = "{icon} {capacity}%";
325
325
-
format-icons = [ "" "" "" "" "" "" "" "" "" "" ];
326
326
-
states = {
327
327
-
battery-10 = 10;
328
328
-
battery-20 = 20;
329
329
-
battery-30 = 30;
330
330
-
battery-40 = 40;
331
331
-
battery-50 = 50;
332
332
-
battery-60 = 60;
333
333
-
battery-70 = 70;
334
334
-
battery-80 = 80;
335
335
-
battery-90 = 90;
336
336
-
battery-100 = 100;
337
337
-
};
338
338
-
# <https://github.com/Alexays/Waybar/issues/1938>
339
339
-
# the wiki lies about this, does not match
340
340
-
# /sys/class/power_supply/BAT0/status
341
341
-
format-plugged = " AC";
342
342
-
format-charging-battery-10 = " {capacity}%";
343
343
-
format-charging-battery-20 = " {capacity}%";
344
344
-
format-charging-battery-30 = " {capacity}%";
345
345
-
format-charging-battery-40 = " {capacity}%";
346
346
-
format-charging-battery-50 = " {capacity}%";
347
347
-
format-charging-battery-60 = " {capacity}%";
348
348
-
format-charging-battery-70 = " {capacity}%";
349
349
-
format-charging-battery-80 = " {capacity}%";
350
350
-
format-charging-battery-90 = " {capacity}%";
351
351
-
format-charging-battery-100 = " {capacity}%";
352
352
-
};
353
353
-
354
354
-
idle_inhibitor = {
355
355
-
format = "{icon}";
356
356
-
format-icons = {
357
357
-
activated = "";
358
358
-
deactivated = "";
359
359
-
};
360
360
-
tooltip-format-activated =
361
361
-
"Idle timer inhibited, device will not sleep.";
362
362
-
tooltip-format-deactivated =
363
363
-
"Idle timer enabled, device will sleep when not in use.";
364
364
-
};
365
365
-
};
366
366
-
};
367
367
-
368
368
-
imports = [
369
369
-
(lib.mkIf config.programs.waybar.systemd.enable {
370
370
-
xdg.configFile."waybar/config".onChange = lib.mkOverride 90 ''
371
371
-
if [ -z "''${_reloaded_waybar-}" ]; then
372
372
-
_reloaded_waybar=1
373
373
-
${pkgs.systemd}/bin/systemctl --user restart waybar.service
374
374
-
fi
375
375
-
'';
376
376
-
xdg.configFile."waybar/style.css".onChange = lib.mkOverride 90 ''
377
377
-
if [ -z "''${_reloaded_waybar-}" ]; then
378
378
-
_reloaded_waybar=1
379
379
-
${pkgs.systemd}/bin/systemctl --user restart waybar.service
380
380
-
fi
381
381
-
'';
382
382
-
})
383
383
-
];
384
384
-
}
-236
home-manager/hyprland/waybar.scss
···
1
1
-
$default-foreground: #ebdbb2;
2
2
-
$highlight-foreground: #fbf1c7;
3
3
-
4
4
-
* {
5
5
-
all: unset;
6
6
-
font-family: Ubuntu, "Material Design Icons";
7
7
-
font-size: 10.5pt;
8
8
-
color: $default-foreground;
9
9
-
}
10
10
-
11
11
-
@mixin oscillate-highlight($function, $stop, $background, $duration) {
12
12
-
$name: inline-#{unique-id()};
13
13
-
14
14
-
@keyframes #{$name} {
15
15
-
#{$stop} {
16
16
-
background: $background;
17
17
-
color: $highlight-foreground;
18
18
-
}
19
19
-
}
20
20
-
21
21
-
animation-name: $name;
22
22
-
animation-duration: $duration;
23
23
-
animation-iteration-count: infinite;
24
24
-
animation-timing-function: $function;
25
25
-
}
26
26
-
27
27
-
@mixin breathe-highlight($background, $duration) {
28
28
-
@include oscillate-highlight(ease-in-out, 50%, $background, $duration);
29
29
-
}
30
30
-
31
31
-
@mixin pulse-highlight($stop, $background, $duration) {
32
32
-
@include oscillate-highlight(ease-out, $stop, $background, $duration);
33
33
-
}
34
34
-
35
35
-
@mixin indicate-active($color, $selector) {
36
36
-
transition:
37
37
-
box-shadow 300ms ease-in,
38
38
-
background 300ms ease-in;
39
39
-
40
40
-
#{$selector} {
41
41
-
transition:
42
42
-
box-shadow 600ms ease-out,
43
43
-
background 600ms ease-out;
44
44
-
box-shadow: 0 2px 0 0 $color inset;
45
45
-
background: #3c3836;
46
46
-
}
47
47
-
}
48
48
-
49
49
-
@mixin indicate-hover($color) {
50
50
-
transition:
51
51
-
background 120ms ease-in;
52
52
-
53
53
-
&:hover {
54
54
-
transition:
55
55
-
background 120ms ease-out;
56
56
-
background: $color;
57
57
-
}
58
58
-
}
59
59
-
60
60
-
#clock,
61
61
-
#submap,
62
62
-
#backlight,
63
63
-
#network,
64
64
-
#bluetooth,
65
65
-
#cpu,
66
66
-
#temperature,
67
67
-
#pulseaudio,
68
68
-
#memory,
69
69
-
#battery,
70
70
-
#idle_inhibitor,
71
71
-
#tray,
72
72
-
#mpris,
73
73
-
#window {
74
74
-
padding-left: 8px;
75
75
-
padding-right: 8px;
76
76
-
}
77
77
-
78
78
-
window#waybar {
79
79
-
// background: #1d2021;
80
80
-
background: #000000;
81
81
-
// border-bottom: 1px solid #3c3836;
82
82
-
}
83
83
-
84
84
-
tooltip,
85
85
-
window.popup {
86
86
-
background: #282828;
87
87
-
border: 1px solid #665c54;
88
88
-
// border-radius: 3px;
89
89
-
}
90
90
-
91
91
-
window.popup {
92
92
-
menu {
93
93
-
padding: 5px 0;
94
94
-
95
95
-
arrow {
96
96
-
min-width: 16px;
97
97
-
min-height: 16px;
98
98
-
99
99
-
&.top {
100
100
-
-gtk-icon-source: -gtk-icontheme("pan-up-symbolic");
101
101
-
}
102
102
-
103
103
-
&.bottom {
104
104
-
-gtk-icon-source: -gtk-icontheme("pan-down-symbolic");
105
105
-
}
106
106
-
107
107
-
&.right {
108
108
-
-gtk-icon-source: -gtk-icontheme("pan-end-symbolic");
109
109
-
}
110
110
-
111
111
-
&.left {
112
112
-
-gtk-icon-source: -gtk-icontheme("pan-start-symbolic");
113
113
-
}
114
114
-
}
115
115
-
116
116
-
menuitem {
117
117
-
padding: 4px 8px;
118
118
-
119
119
-
transition:
120
120
-
color 66ms ease-in,
121
121
-
background 66ms ease-in;
122
122
-
123
123
-
&:hover {
124
124
-
transition:
125
125
-
color 100ms ease-out,
126
126
-
background 100ms ease-out;
127
127
-
128
128
-
color: $highlight-foreground;
129
129
-
background: #689d6a;
130
130
-
}
131
131
-
}
132
132
-
133
133
-
separator {
134
134
-
min-height: 1px;
135
135
-
background: #665c54;
136
136
-
margin: 4px 0;
137
137
-
}
138
138
-
}
139
139
-
}
140
140
-
141
141
-
#clock.time {
142
142
-
font-weight: bold;
143
143
-
}
144
144
-
145
145
-
#tray {
146
146
-
&>* {
147
147
-
@include indicate-hover(#282828);
148
148
-
}
149
149
-
}
150
150
-
151
151
-
#mpris {
152
152
-
@include indicate-hover(#282828);
153
153
-
}
154
154
-
155
155
-
#submap {
156
156
-
@include indicate-active(#d3869b, "&");
157
157
-
}
158
158
-
159
159
-
#workspaces {
160
160
-
button {
161
161
-
min-width: 26px;
162
162
-
padding: 6px;
163
163
-
164
164
-
@include indicate-hover(#282828);
165
165
-
@include indicate-active(#f38019, "&.active");
166
166
-
167
167
-
&.urgent {
168
168
-
animation-delay: 5s;
169
169
-
@include pulse-highlight(10%, #458588, 1.5s);
170
170
-
}
171
171
-
}
172
172
-
}
173
173
-
174
174
-
#network {
175
175
-
@include indicate-hover(#282828);
176
176
-
@include indicate-active(#689d6a, "&.wifi");
177
177
-
@include indicate-active(#458588, "&.ethernet");
178
178
-
@include indicate-active(#b16286, "&.linked");
179
179
-
}
180
180
-
181
181
-
#bluetooth {
182
182
-
@include indicate-hover(#282828);
183
183
-
@include indicate-active(#458588, "&.on");
184
184
-
@include indicate-active(#98971a, "&.connected");
185
185
-
186
186
-
&.on {
187
187
-
@include breathe-highlight(#458588, 5s);
188
188
-
}
189
189
-
190
190
-
// &.discoverable {
191
191
-
// @include breathe-highlight(#b16286, 5s);
192
192
-
// }
193
193
-
194
194
-
// &.discovering {
195
195
-
// @include breathe-highlight(#b16286, 5s);
196
196
-
// }
197
197
-
198
198
-
// &.pairable:not(.connected) {
199
199
-
// @include breathe-highlight(#b16286, 5s);
200
200
-
// }
201
201
-
}
202
202
-
203
203
-
#battery {
204
204
-
&.battery-30:not(.charging) {
205
205
-
@include breathe-highlight(#d64d0e, 10s);
206
206
-
}
207
207
-
208
208
-
&.battery-20:not(.charging) {
209
209
-
@include pulse-highlight(10%, #d64d0e, 5s);
210
210
-
}
211
211
-
212
212
-
&.battery-10:not(.charging) {
213
213
-
@include pulse-highlight(30%, #cc241d, 750ms);
214
214
-
}
215
215
-
}
216
216
-
217
217
-
#temperature.critical {
218
218
-
@include pulse-highlight(30%, #cc241d, 750ms);
219
219
-
}
220
220
-
221
221
-
#idle_inhibitor {
222
222
-
@include indicate-hover(#282828);
223
223
-
@include indicate-active(#d79921, "&.activated");
224
224
-
225
225
-
&.activated {
226
226
-
@include pulse-highlight(10%, #d79921, 5s);
227
227
-
}
228
228
-
}
229
229
-
230
230
-
#pulseaudio {
231
231
-
@include indicate-hover(#282828);
232
232
-
233
233
-
&.output:not(.safe) {
234
234
-
@include breathe-highlight(#cc241d, 10s);
235
235
-
}
236
236
-
}