polybar: define the module "battery" and use it (only for buzz)

This commit is contained in:
inkch 2024-03-15 15:37:34 +09:00
parent 514c71a5f9
commit fa61c8ff8c

View File

@ -65,7 +65,7 @@ modules-right = pueue filesystem temp cpu memory eth-down eth-up ipv6 caffeine c
{{- else if eq .chezmoi.hostname "buzz" }}
modules-left = i3 xwindow
modules-center = date
modules-right = filesystem temp cpu memory tray
modules-right = filesystem temp cpu memory battery tray
{{- end }}
@ -81,6 +81,36 @@ type = internal/tray
tray-padding = 4
tray-size = 75%
{{ if eq .chezmoi.hostname "buzz" }}
[module/battery]
type = internal/battery
; This is useful in case the battery never reports 100% charge
; Default: 100
full-at = 98
; format-low once this charge percentage is reached
; Default: 10
; New in version 3.6.0
low-at = 15
; Use the following command to list batteries and adapters:
; $ ls -1 /sys/class/power_supply/
battery = BAT0
adapter = AC
; If an inotify event haven't been reported in this many
; seconds, manually poll for new values.
;
; Needed as a fallback for systems that don't report events
; on sysfs/procfs.
;
; Disable polling by setting the interval to 0.
;
; Default: 5
poll-interval = 5
{{ end }}
[module/pueue]
type = custom/script
interval = 5