nix-configs/modules/desktop/polybar.nix

150 lines
4.6 KiB
Nix

{
config,
lib,
pkgs,
...
}: {
config = {
home-manager.users.jade = {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";
label-active = "";
label-active-padding = 1;
label-occupied = "";
label-occupied-padding = 1;
label-urgent = "";
label-urgent-foreground = "\${colors.alert}";
label-urgent-padding = 1;
label-empty = "";
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;
};
};
};
};
};
}