nix-configs/modules/desktop/polybar.nix

151 lines
4.6 KiB
Nix
Raw Permalink Normal View History

2023-02-13 12:54:21 +01:00
{
config,
lib,
pkgs,
...
}: {
2023-02-13 12:54:21 +01:00
config = {
home-manager.users.jade = {pkgs, ...}: {
2023-02-13 12:54:21 +01:00
services.polybar = {
enable = true;
2023-04-22 14:57:32 +02:00
package = pkgs.polybarFull;
2023-02-13 12:54:21 +01:00
script = "";
settings = {
colors = {
background = "#282828";
background-alt = "#3c3836";
foreground = "#ebdbb2";
primary = "#d65d0e";
secondary = "#fe8019";
alert = "#cc241d";
disabled = "#504945";
};
"bar/status" = {
# Style
2023-12-06 13:14:02 +01:00
bottom = true;
2023-02-13 12:54:21 +01:00
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";
2023-02-13 12:54:21 +01:00
cursor-click = "pointer";
cursor-scroll = "ns-resize";
enable-ipc = true;
2023-04-22 14:57:32 +02:00
wm-restack = "generic";
2023-02-13 12:54:21 +01:00
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;
2023-07-29 17:19:17 +02:00
format-prefix = "󰍛 ";
2023-02-13 12:54:21 +01:00
format-prefix-foreground = "\${colors.primary}";
label = "%percentage_used:2%%";
};
"module/cpu" = {
type = "internal/cpu";
interval = "2";
2023-11-18 14:37:28 +01:00
format-prefix = "󰻠 ";
2023-02-13 12:54:21 +01:00
format-prefix-foreground = "\${colors.primary}";
label = "%percentage:2%%";
};
"network-base" = {
type = "internal/network";
interval = 5;
format-connected = "<ramp-signal> <label-connected>";
2023-02-13 12:54:21 +01:00
format-disconnected = "<label-disconnected>";
label-disconnected = "󰣼";
label-disconnected-foreground = "#d65d0e";
2023-11-18 14:37:28 +01:00
ramp.signal = [
"%{F#cc241d}󰣾"
2023-11-20 01:29:07 +01:00
"%{F#d79921}󰣴"
"%{F#98971a}󰣶"
"%{F#98971a}󰣸"
"%{F#98971a}󰣺"
2023-11-18 14:37:28 +01:00
];
2023-02-13 12:54:21 +01:00
};
"module/wlan" = {
"inherit" = "network-base";
interface-type = "wireless";
label-connected = "%{F#F0C674}%{F-} %local_ip%";
2023-02-13 12:54:21 +01:00
};
"battery-base" = {
2023-02-13 12:54:21 +01:00
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>";
2023-11-18 14:37:28 +01:00
label-discharging = "%{F#ebdbb2}%percentage%%%{F#bdae93} %time%";
2023-02-13 12:54:21 +01:00
format-discharging = "<ramp-capacity> <label-discharging>";
2023-11-20 01:29:07 +01:00
label-full = "%{F#98971a}󰁹%{F#ebdbb2} %percentage%%";
format-full = "<label-full>";
2023-11-20 01:29:07 +01:00
label-low = "%{F#cc241d}󰂎%{F#ebdbb2} %percentage%%";
format-low = "<label-low>";
2023-11-18 14:37:28 +01:00
ramp.capacity = [
"%{F#cc241d}󰁺"
2023-11-20 01:29:07 +01:00
"%{F#d79921}󰁻"
"%{F#98971a}󰁼"
"%{F#98971a}󰁽"
"%{F#98971a}󰁾"
"%{F#98971a}󰁿"
"%{F#98971a}󰂀"
"%{F#98971a}󰂁"
"%{F#98971a}󰂂"
"%{F#98971a}󰁹"
2023-11-18 14:37:28 +01:00
];
2023-02-13 12:54:21 +01:00
};
"module/bat0" = {
"inherit" = "battery-base";
battery = "BAT0";
adapter = "ADP1";
};
"module/bat1" = {
"inherit" = "battery-base";
battery = "BAT1";
adapter = "ADP1";
};
2023-02-13 12:54:21 +01:00
"settings" = {
screenchange-reload = true;
pseudo-transparency = true;
};
};
};
};
};
}