dotfiles/nixos/i3/polybar/polybar.nix

97 lines
2.4 KiB
Nix
Raw Permalink Normal View History

2022-12-19 09:09:08 +00:00
{
config,
pkgs,
...
}: {
2019-07-14 14:45:41 +01:00
services.polybar = {
enable = true;
2019-07-14 16:09:41 +01:00
script = "polybar -r main_bar &";
2019-07-14 19:24:40 +01:00
package = pkgs.polybar.override {
i3GapsSupport = true;
alsaSupport = true;
iwSupport = true;
nlSupport = false;
githubSupport = true;
};
2019-07-14 14:45:41 +01:00
config = {
2022-12-19 09:09:08 +00:00
"settings" = {screenchange-reload = "true";};
2019-07-14 14:45:41 +01:00
"bar/main_bar" = {
2019-07-14 19:24:40 +01:00
font-0 = "DejaVu Sans Mono for Powerline:size=12.0;weight=bold";
2019-08-24 08:56:37 +01:00
font-1 = "Weather Icons:size=12;0";
2019-07-14 16:09:41 +01:00
background = "#002b36";
foreground = "#839496";
2019-07-14 14:45:41 +01:00
bottom = "false";
2019-07-14 19:24:40 +01:00
height = 32;
2019-07-14 14:45:41 +01:00
fixed-center = "true";
line-size = 6;
padding-right = "1%";
module-margin-left = 1;
module-margin-right = 1;
2019-07-14 19:30:06 +01:00
modules-left = "i3";
2020-04-18 11:59:42 +01:00
modules-center = "date ";
modules-right = "memory swap cpu battery1 battery0";
2019-07-16 08:17:37 +01:00
tray-position = "right";
2019-07-14 14:45:41 +01:00
};
2019-07-14 19:24:40 +01:00
2019-07-14 14:45:41 +01:00
"module/date" = {
type = "internal/date";
interval = 5;
2019-07-14 16:09:41 +01:00
date = "%a %d.%m";
2019-07-14 14:45:41 +01:00
time = "%H:%M";
label = "%date% %time%";
};
2019-07-14 19:24:40 +01:00
2019-08-24 08:56:37 +01:00
"module/weather" = {
type = "custom/script";
interval = 600;
2022-12-19 09:09:08 +00:00
exec = "${pkgs.bash}/bin/bash -c 'source ~/dev/dotfiles/nixos/i3/polybar/openweathermap-fullfeatured.sh'";
2019-08-24 08:56:37 +01:00
label-font = 2;
};
2022-12-19 09:09:08 +00:00
"module/i3" = {type = "internal/i3";};
2019-07-14 19:24:40 +01:00
2019-07-14 14:45:41 +01:00
"module/cpu" = {
type = "internal/cpu";
2019-07-14 21:21:42 +01:00
interval = 5;
2019-07-14 19:24:40 +01:00
format = "CPU: <label>";
2019-07-14 14:45:41 +01:00
};
2019-07-14 19:24:40 +01:00
2019-08-18 11:13:13 +01:00
"module/temperature" = {
type = "custom/script";
2019-08-18 11:13:13 +01:00
interval = 5;
2022-12-19 09:09:08 +00:00
exec = "${pkgs.bash}/bin/bash -c 'source ~/dev/dotfiles/nixos/i3/polybar/cpu-temp.sh'";
2019-08-18 11:13:13 +01:00
};
2019-07-14 14:45:41 +01:00
"module/memory" = {
type = "internal/memory";
2019-07-14 21:21:42 +01:00
interval = 5;
2019-07-14 19:24:40 +01:00
label = "MEM: %percentage_used%%";
2019-07-14 14:45:41 +01:00
};
2019-07-14 19:24:40 +01:00
2019-07-14 21:21:42 +01:00
"module/swap" = {
type = "internal/memory";
interval = 15;
label = "SWAP: %percentage_swap_used%%";
2019-07-14 19:24:40 +01:00
};
"module/battery0" = {
type = "internal/battery";
battery = "BAT0";
adapter = "AC";
poll-interval = "5";
2019-07-15 20:52:19 +01:00
format-discharging = "<label-discharging>";
label-discharging = "%time%";
2019-07-14 19:24:40 +01:00
};
"module/battery1" = {
type = "internal/battery";
battery = "BAT1";
adapter = "AC";
poll-interval = "5";
2019-07-15 20:52:19 +01:00
format-discharging = "<label-discharging>";
label-discharging = "%time%";
2019-07-14 14:45:41 +01:00
};
};
};
}