diff options
| author | Cori Barker <coribarker2@gmail.com> | 2026-03-23 11:30:32 +0000 |
|---|---|---|
| committer | Cori Barker <coribarker2@gmail.com> | 2026-03-23 11:30:32 +0000 |
| commit | 8262be41891cb7e7727515c752c86c56e4f81b5e (patch) | |
| tree | efedf15a68d574d8ccb0528763c3331928503eb4 | |
| parent | 26b61c7703acb1362d4d2d456d66ecf2b01673b5 (diff) | |
[polybar] fixed battery status
| -rw-r--r-- | config.ini | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -22,7 +22,7 @@ module-margin-right = 0 font-0 = "Fira Nerd Font:pixelsize=11:antialias=true;3" modules-left = xmonad modules-center = -modules-right = cpu memory volume date time +modules-right = cpu memory volume battery date time tray-position = right tray-padding = 6 tray-background = ${colors.bg} @@ -63,6 +63,15 @@ format-padding = 2 format-margin-left = 2 label = VOL %output% label-foreground = ${colors.fg-dim} +[module/battery] +type = custom/script +exec = now=$(cat /sys/class/power_supply/BAT0/charge_now); full=$(cat /sys/class/power_supply/BAT0/charge_full); status=$(cat /sys/class/power_supply/BAT0/status); pct=$((now * 100 / full)); suffix=""; [ "$status" = "Charging" ] && suffix=" ↑"; [ "$pct" -ge 98 ] && echo "BAT FULL" || echo "BAT ${pct}%${suffix}" +interval = 30 +format = <label> +format-background = ${colors.bg-alt} +format-padding = 2 +format-margin-left = 2 +label-foreground = ${colors.fg-dim} [module/date] type = internal/date interval = 10 |
