nix-configs/modules/desktop-environment/home/panels/polybar.nix

147 lines
4 KiB
Nix
Raw Permalink Normal View History

2024-03-06 10:09:02 +00:00
{
config,
lib,
pkgs,
...
}: {
services.polybar = {
enable = true;
package = pkgs.polybarFull;
script = "";
settings = {
colors = {
background = "#282828";
background-alt = "#3c3836";
foreground = "#ebdbb2";
primary = "#d65d0e";
secondary = "#fe8019";
alert = "#cc241d";
disabled = "#504945";
};
"bar/status" = {
# Style
bottom = true;
width = "100%";
height = "24px";
radius = 0;
tray-position = "center";
background = "\${colors.background}";
foreground = "\${colors.foreground}";
line-size = "4px";
border-color = "#00000000";
padding-left = 0;
padding-right = 1;
module-margin = 1;
separator = "|";
separator-foreground = "\${colors.disabled}";
font-0 = "FiraCode Nerd Font";
modules-left = "xworkspaces xwindow";
modules-right = "memory cpu wlan bat0 bat1";
cursor-click = "pointer";
cursor-scroll = "ns-resize";
enable-ipc = true;
wm-restack = "generic";
override-redirect = false;
};
"module/xworkspaces" = {
type = "internal/xworkspaces";
2024-04-16 19:36:14 +00:00
label-active = "";
2024-03-06 10:09:02 +00:00
label-active-padding = 1;
2024-04-16 19:36:14 +00:00
label-occupied = "";
2024-03-06 10:09:02 +00:00
label-occupied-padding = 1;
label-urgent = "";
label-urgent-foreground = "\${colors.alert}";
label-urgent-padding = 1;
2024-04-16 19:36:14 +00:00
label-empty = "";
2024-03-06 10:09:02 +00:00
label-empty-foreground = "\${colors.disabled}";
label-empty-padding = 1;
};
"module/xwindow" = {
type = "internal/xwindow";
label = "%title:0:60:...%";
};
"module/memory" = {
type = "internal/memory";
interval = 2;
format-prefix = "󰍛 ";
format-prefix-foreground = "\${colors.primary}";
label = "%percentage_used:2%%";
};
"module/cpu" = {
type = "internal/cpu";
interval = "2";
format-prefix = "󰻠 ";
format-prefix-foreground = "\${colors.primary}";
label = "%percentage:2%%";
};
"network-base" = {
type = "internal/network";
interval = 5;
format-connected = "<ramp-signal> <label-connected>";
format-disconnected = "<label-disconnected>";
label-disconnected = "󰣼";
label-disconnected-foreground = "#d65d0e";
ramp.signal = [
"%{F#cc241d}󰣾"
"%{F#d79921}󰣴"
"%{F#98971a}󰣶"
"%{F#98971a}󰣸"
"%{F#98971a}󰣺"
];
};
"module/wlan" = {
"inherit" = "network-base";
interface-type = "wireless";
label-connected = "%{F#F0C674}%{F-} %local_ip%";
};
"battery-base" = {
type = "internal/battery";
poll-interval = 1;
time-format = "%H%{F#7c6f64}:%{F#d5c4a1}%M";
label-charging = "%{F#98971a}󰚥 %{F#ebdbb2}%percentage%%%{F#d5c4a1} %time%";
format-charging = "<ramp-capacity> <label-charging>";
label-discharging = "%{F#ebdbb2}%percentage%%%{F#bdae93} %time%";
format-discharging = "<ramp-capacity> <label-discharging>";
label-full = "%{F#98971a}󰁹%{F#ebdbb2} %percentage%%";
format-full = "<label-full>";
label-low = "%{F#cc241d}󰂎%{F#ebdbb2} %percentage%%";
format-low = "<label-low>";
ramp.capacity = [
"%{F#cc241d}󰁺"
"%{F#d79921}󰁻"
"%{F#98971a}󰁼"
"%{F#98971a}󰁽"
"%{F#98971a}󰁾"
"%{F#98971a}󰁿"
"%{F#98971a}󰂀"
"%{F#98971a}󰂁"
"%{F#98971a}󰂂"
"%{F#98971a}󰁹"
];
};
"module/bat0" = {
"inherit" = "battery-base";
battery = "BAT0";
adapter = "ADP1";
};
"module/bat1" = {
"inherit" = "battery-base";
battery = "BAT1";
adapter = "ADP1";
};
"settings" = {
screenchange-reload = true;
pseudo-transparency = true;
};
};
};
}