nix-configs/modules/desktop/polybar.nix

154 lines
4.9 KiB
Nix
Raw Normal View History

2023-02-13 12:54:21 +01:00
{ config, lib, pkgs, ... }:
{
config = {
home-manager.users.jade = { pkgs, ... }: {
2023-04-22 14:57:32 +02:00
#xsession.windowManager.i3.config.startup = [
#{
#command = "pkill polybar; polybar";
#always = true;
#}
#];
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
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 battery date";
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}󰣾"
"%{F#d65d0e}󰣴"
"%{F#d65d0e}󰣶"
"%{F#d65d0e}󰣸"
"%{F#bdae93}󰣺"
];
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
};
"module/battery" = {
type = "internal/battery";
poll-interval = 1;
battery = "BAT0";
adapter = "ADP1";
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>";
label-full = "%{F#d65d0e}󰁹%{F#ebdbb2} %percentage%%";
format-full = "<label-full>";
label-low = "%{F#d65d0e}󰂎%{F#ebdbb2} %percentage%%";
format-low = "<label-low>";
2023-11-18 14:37:28 +01:00
ramp.capacity = [
"%{F#cc241d}󰁺"
"%{F#cc241d}󰁻"
"%{F#d65d0e}󰁼"
"%{F#d65d0e}󰁽"
"%{F#d65d0e}󰁾"
"%{F#d65d0e}󰁿"
"%{F#d65d0e}󰂀"
"%{F#d65d0e}󰂁"
"%{F#bdae93}󰂂"
"%{F#bdae93}󰁹"
];
2023-02-13 12:54:21 +01:00
};
"module/date" = {
type = "internal/date";
interval = 1;
date = "%Y%{F#7c6f64}-%{F#ebdbb2}%m%{F#7c6f64}-%{F#ebdbb2}%d";
time = "%H%{F#7c6f64}:%{F#ebdbb2}%M%{F#7c6f64}:%{F#ebdbb2}%S";
label = "%{F#d65d0e}󰃭%{F#ebdbb2} %date% %{F#d65d0e}󱑌%{F#ebdbb2} %time%";
2023-02-13 12:54:21 +01:00
};
"settings" = {
screenchange-reload = true;
pseudo-transparency = true;
};
};
};
};
};
}