dotfiles/hosts/thinkpad/configs/polybar/top.nix

168 lines
4.8 KiB
Nix
Raw Normal View History

let
colors = {
fg = "#FFFFFF";
bg = "#191830";
border = "#F72585";
warn = "#f00";
altfg = "#F72585";
invisible = "#00400080";
currentWorkspace = "#FAD000";
seperatorColor = "#FAD000";
};
script = "~/.config/scripts";
in
{
home-manager.users.grape.services.polybar = {
config = {
"module/date" = {
type = "internal/date";
font-1 = "Jetbrains Mono Nerd font";
interval = 1;
time = "%I:%M:%S";
date = "%Y-%m-%d%";
label = "%time% %date%";
2024-12-05 07:02:26 +01:00
format = "%{T2}%{F${colors.bg}}%{F-}%{T-}<label>%{T2}%{F${colors.bg}}%{F-}%{T-}";
label-foreground = "${colors.fg}";
label-background = "${colors.fg}";
};
# TODO include labels right into format for each module instea dof having a different module
"module/fs-label-system" = {
type = "custom/text";
label = "SYS ";
label-foreground = "${colors.seperatorColor}";
};
"module/fs-label-data" = {
type = "custom/text";
label = "DAT ";
label-foreground = "${ colors. seperatorColor}";
};
"module/ewmh" = {
type = "internal/xworkspaces";
pin-workspaces = false;
label-active-foreground = "${colors.currentWorkspace}";
};
"module/cpu-temp" = {
2024-12-05 07:02:26 +01:00
base-temperature = "20";
format = "%{T2}%{F#191830}%{F-}%{T-}%{B#191830}%{F#FAD000}CPU %{F-}<label>%{B-}";
format-warn = "%{T2}%{F#191830}%{F-}%{T-}%{B#191830}%{F#FAD000}CPU %{F-}<label-warn>%{B-}";
hwmon-path = "/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input";
label-background = "#191830";
label-foreground = "#FFFFFF";
label-warn-foreground = "#f00";
label = "%temperature% ";
thermal-zone = 0;
type = "internal/temperature";
warn-temperature = 85;
zone-type = "x86_pkg_temp";
};
"module/cpu-usage" = {
type = "internal/cpu";
interval = "1.5";
label = "CPU %percentage%%";
2024-12-05 07:02:26 +01:00
format = "%{T2}%{F#191830}%{F-}%{T-}%{B${colors.bg}}<label>";
label-foreground = "${colors.fg}";
label-background = "${colors.fg}";
};
"module/gpu-temp" = {
type = "custom/script";
interval = "1.5";
exec = "nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits";
format = "%{T2}%{F#191830}%{F-}%{T-}%{B${colors.bg}}%{F${colors.seperatorColor}}GPU %{F-}%{B-}<label>";
2024-08-14 18:40:07 +02:00
label-foreground = colors.fg;
format-suffix = "°C ";
};
"module/gpu-usage" = {
type = "custom/script";
interval = "1.5";
exec = "nvidia-smi --query-gpu=memory.used --format=csv,noheader,nounits";
2024-08-14 18:40:07 +02:00
format = "<label> mb%{T2}%{F#191830}%{F-}%{T-}";
};
"module/memory" = {
type = "internal/memory";
interval = 1;
format = "%{F${colors.seperatorColor}}RAM%{F-} <label>";
label = "%used%";
label-warn = "%used%";
warn-percentage = 60;
label-warn-foreground = "${colors.warn}";
};
"fs-base" = {
type = "internal/fs";
label-unmounted = "?";
format-prefix-foreground = "${colors.fg}";
warn-precentage = "80%";
};
"module/fs-system" = {
"inherit" = "fs-base";
mount-0 = "/";
interval = 30;
label-mounted = "%free%(%total%)";
};
"module/fs-data" = {
"inherit" = "fs-base";
mount-0 = "/mnt/terra";
interval = 30;
label-mounted = "%free%(%total%)";
};
"module/battery" = {
type = "internal/battery";
full-at = 95;
low-at = 20;
battery = "BAT0";
adapter = "AC0";
poll-interval = 4;
};
"module/keyboard" = {
type = "internal/xkeyboard";
2024-12-05 07:02:26 +01:00
format = "%{T2}%{F#191830}%{F-}%{T-}%{B#191830}<label-layout>%{B-}%{B#191830}%{F#FAD000} <label-indicator>%{T-}%{B-}%{T2}%{F#191830}%{F-}%{T-}";
label-layout-background = "#191830";
label-layout-foreground = "#FFFFFF";
label-indicator-on-capslock = "CAPS";
};
"global/wm" = {
override-redirect = false;
};
"bar/default" = {
2024-12-05 07:02:26 +01:00
background = "#00191830";
border-color = "#00400080";
border-size = "10px";
bottom = "false";
font-0 = "Jetbrains Mono Nerd font:size=11;3";
2024-12-05 07:02:26 +01:00
font-1 = "Jetbrains Mono Nerd font:size=22;5";
foreground = "#FFFFFF";
height = 34;
modules-center = "ewmh";
modules-left = "date s keyboard battery";
2024-12-05 07:02:26 +01:00
modules-right = " fs-data s fs-system s memory s start gpu-temp gpu-usage end s cpu-temp cpu-usage";
padding-left = 2;
padding-right = 2;
radius = 15;
2024-12-05 07:02:26 +01:00
width = "100%";
};
};
};
}