configs/polybar: init and configure for a few hosts

This commit is contained in:
Aaron Bieber 2024-01-21 13:24:34 -07:00
parent a8510c3cf8
commit dd311640f2
No known key found for this signature in database
2 changed files with 130 additions and 4 deletions

View File

@ -7,13 +7,14 @@
./dns.nix
./doas.nix
./git.nix
./neovim.nix
./peerix.nix
./manager.nix
./tmux.nix
./neovim.nix
./net-overlay.nix
./zsh.nix
./nix.nix
./peerix.nix
./polybar.nix
./tmux.nix
./update.nix
./zsh.nix
];
}

125
configs/polybar.nix Normal file
View File

@ -0,0 +1,125 @@
{ pkgs, ... }:
let
barBase = {
background = "\${colors.background}";
foreground = "\${colors.foreground}";
border-color = "#DEDeff";
border-size = "2pt";
width = "100%";
height = "24pt";
enable-ipc = true;
font-0 = "Go Mono;3";
line-size = "3pt";
module-margin = 1;
padding = 2;
radius = 15;
separator = "|";
modules-left = "xworkspaces";
modules-right = "wifi ethernet memory cpu battery date";
};
settings = {
colors = {
background = "#ffffea";
background-alt = "#373B41";
foreground = "#000000";
primary = "#F0C674";
secondary = "#8ABEB7";
alert = "#A54242";
disabled = "#707880";
};
"module/cpu" = {
type = "internal/cpu";
interval = 2;
format-prefix = "CPU: ";
label = "%percentage:2%%";
};
"module/date" = {
type = "internal/date";
interval = 1;
date = "%H:%M";
date-alt = "%Y-%m-%d %H:%M:%S";
label = "%date%";
};
"module/memory" = {
type = "internal/memory";
interval = 2;
format-prefix = "RAM: ";
label = "%percentage_used:2%%";
};
"module/xworkspaces" = {
type = "internal/xworkspaces";
};
"module/xwindow" = {
type = "internal/xwindow";
};
"module/systray" = {
type = "internal/tray";
};
"module/battery" = {
type = "internal/battery";
full-at = 99;
low-at = 5;
# $ ls -1 /sys/class/power_supply/
battery = "BAT1";
adapter = "ACAD";
poll-interval = 5;
time-format = "%H:%M";
label-charging = "+%percentage%%";
label-discharging = "-%percentage%%";
label-low = "BATTERY LOW";
};
"module/wifi" = {
type = "internal/network";
interface-type = "wireless";
accumulate-stats = true;
label-connected = "%essid% %netspeed%";
};
"module/ethernet" = {
type = "internal/network";
interface-type = "wired";
accumulate-stats = true;
label-connected = "%netspeed%";
};
"bar/europa" = barBase // { };
"bar/clunk" = barBase // { };
};
settingsFormat = pkgs.formats.ini { };
settingsFile = settingsFormat.generate "polybar-config.ini" settings;
in
{
config = {
environment = {
systemPackages = [ pkgs.polybar ];
etc = {
"xdg/polybar/config.ini".text = builtins.readFile settingsFile;
};
};
fonts = { packages = [ pkgs.go-font ]; };
};
}