-
Notifications
You must be signed in to change notification settings - Fork 0
/
waybar.nix
152 lines (150 loc) · 4.02 KB
/
waybar.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
{
config,
pkgs,
lib,
...
}: let
shim = import ./pkgs/shim.nix { inherit pkgs; };
plasma-waybar = ./files/plasma-waybar.py;
plasmoids = {
eventcal = {
title = "Calendar";
width = 500;
height = 500;
margin_right = 0;
plasmoid = "org.kde.plasma.calendar";
};
battery = {
title = "Power and Battery";
width = 500;
height = 270;
margin_right = 60;
plasmoid = "org.kde.plasma.battery";
};
network = {
title = "Networks";
width = 500;
height = 500;
margin_right = 80;
plasmoid = "org.kde.plasma.networkmanagement";
};
bluetooth = {
title = "Bluetooth";
width = 500;
height = 500;
margin_right = 105;
plasmoid = "org.kde.plasma.bluetooth";
};
audio = {
title = "Audio Volume";
width = 600;
height = 270;
margin_right = 125;
plasmoid = "org.kde.plasma.volume";
};
kde-connect = {
title = "KDE Connect";
width = 500;
height = 500;
margin_right = 150;
plasmoid = "org.kde.kdeconnect";
};
};
in {
programs.waybar = {
enable = true;
package = shim {
name = "waybar";
cmds = ["waybar"];
};
style = ./files/theme/waybar.css;
settings = [{
layer = "top";
spacing = 8;
modules-left = ["hyprland/workspaces"];
modules-center = [];
modules-right = [
"tray"
"custom/notification"
"custom/kde-connect"
"pulseaudio"
"bluetooth"
"network"
"battery"
"clock"
];
"hyprland/workspaces".all-outputs = true;
tray.spacing = 10;
"custom/kde-connect" = {
format = "";
on-click = "${plasma-waybar} toggle kde-connect";
};
"custom/notification" = {
tooltip = false;
format = "{icon} ";
format-icons = {
notification = "";
none = "";
dnd-notification = "";
dnd-none = "";
};
return-type = "json";
exec-if = "which swaync-client";
exec = "swaync-client -swb";
on-click = "sleep 0.1 && ${plasma-waybar} hide-all && swaync-client -t -sw";
};
pulseaudio = {
format = "{icon}";
format-bluetooth = "{icon}";
format-bluetooth-muted = " ";
format-muted = " ";
format-icons = {
default = [" " " " " "];
headphone = " ";
};
on-click = "${plasma-waybar} toggle audio";
};
bluetooth = {
format = "";
format-disabled = "";
format-connected = "";
format-connected-battery = "";
on-click = "${plasma-waybar} toggle bluetooth";
};
network = {
format = "{icon} ";
format-icons = ["" "" "" "" ""];
format-linked = " ";
format-ethernet = " ";
format-disconnected = " ";
on-click = "${plasma-waybar} toggle network";
};
battery = {
states = {
warning = 30;
critical = 15;
};
format = "{icon} ";
format-charging = " ";
format-full = " ";
format-icons = ["" "" "" "" ""];
on-click = "${plasma-waybar} toggle battery";
};
clock = {
format = "{:%I:%M %p}";
on-click = "${plasma-waybar} toggle eventcal";
};
}];
};
home.file.".local/bin/plasma-waybar".source = plasma-waybar;
xdg.configFile = {
"hypr/plasmoids.json".text = builtins.toJSON plasmoids;
"hypr/plasmoids.conf".text = builtins.concatStringsSep "\n" (
lib.attrsets.mapAttrsToList (plasmoid_name: plasmoid: ''
windowrulev2 = move 0 -200%,title:^(${plasmoid.title})$
windowrulev2 = workspace special:scratch_${plasmoid_name} silent,title:^(${plasmoid.title})$
windowrulev2 = size ${toString plasmoid.width} ${toString plasmoid.height}, title:^(${plasmoid.title})$
'') plasmoids
);
};
}