dotfiles/nixos/polybar.nix
2019-07-14 19:24:40 +01:00

99 lines
2.4 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";
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 = "xwindow";
modules-center = "date";
modules-right = "backlight volume memory cpu battery-label battery1 battery0";
};
"module/date" = {
type = "internal/date";
interval = 5;
date = "%a %d.%m";
time = "%H:%M";
label = "%date% %time%";
};
"module/xwindow" = {
type = "internal/xwindow";
label = "%title:0:30:...%";
label-padding = 10;
};
"module/cpu" = {
type = "internal/cpu";
interval = 3;
format = "CPU: <label>";
};
"module/memory" = {
type = "internal/memory";
interval = 3;
label = "MEM: %percentage_used%%";
};
"module/volume" = {
type = "internal/pulseaudio";
use-ui-max = true;
format-volume = "<bar-volume>";
};
"module/battery-label" = {
type = "custom/text";
content = "BAT:";
};
"module/battery0" = {
type = "internal/battery";
battery = "BAT0";
adapter = "AC";
poll-interval = "5";
format-discharging = "<label-discharging>";
label-discharging = "%percentage%%|%time%";
};
"module/battery1" = {
type = "internal/battery";
battery = "BAT1";
adapter = "AC";
poll-interval = "5";
format-discharging = "<label-discharging>";
label-discharging = "%percentage%%|%time%";
};
"module/backlight" = {
type = "internal/backlight";
format = "LIGHT: <bar>";
card = "intel_backlight";
bar-width = 6;
bar-indicator = "|";
bar-fill = "";
bar-empty = "";
};
};
};
}