dotfiles/nixos/polybar.nix
2019-10-22 16:52:31 +01:00

97 lines
2.3 KiB
Nix

{ config, pkgs, ... }:
{
services.polybar = {
enable = true;
script = "polybar -r main_bar &";
package = pkgs.polybar.override {
i3GapsSupport = true;
alsaSupport = true;
iwSupport = true;
nlSupport = false;
githubSupport = true;
};
config = {
"settings" = {screenchange-reload = "true";};
"bar/main_bar" = {
font-0 = "DejaVu Sans Mono for Powerline:size=12.0;weight=bold";
font-1 = "Weather Icons:size=12;0";
background = "#002b36";
foreground = "#839496";
bottom = "false";
height = 32;
fixed-center = "true";
line-size = 6;
padding-right = "1%";
module-margin-left = 1;
module-margin-right = 1;
modules-left = "i3";
modules-center = "date weather";
modules-right = "memory swap cpu temperature battery1 battery0";
tray-position = "right";
};
"module/date" = {
type = "internal/date";
interval = 5;
date = "%a %d.%m";
time = "%H:%M";
label = "%date% %time%";
};
"module/weather" = {
type = "custom/script";
interval = 600;
exec = "~/dev/dotfiles/openweathermap-fullfeatured.sh";
label-font = 2;
};
"module/i3" = {
type = "internal/i3";
};
"module/cpu" = {
type = "internal/cpu";
interval = 5;
format = "CPU: <label>";
};
"module/temperature" = {
type = "custom/script";
interval = 5;
exec = "~/dev/dotfiles/cpu-temp.sh";
};
"module/memory" = {
type = "internal/memory";
interval = 5;
label = "MEM: %percentage_used%%";
};
"module/swap" = {
type = "internal/memory";
interval = 15;
label = "SWAP: %percentage_swap_used%%";
};
"module/battery0" = {
type = "internal/battery";
battery = "BAT0";
adapter = "AC";
poll-interval = "5";
format-discharging = "<label-discharging>";
label-discharging = "%time%";
};
"module/battery1" = {
type = "internal/battery";
battery = "BAT1";
adapter = "AC";
poll-interval = "5";
format-discharging = "<label-discharging>";
label-discharging = "%time%";
};
};
};
}