From fa61c8ff8c008708bc98de516fe18f04893499d5 Mon Sep 17 00:00:00 2001 From: inkch Date: Fri, 15 Mar 2024 15:37:34 +0900 Subject: [PATCH] polybar: define the module "battery" and use it (only for buzz) --- dot_config/polybar/config.ini.tmpl | 32 +++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/dot_config/polybar/config.ini.tmpl b/dot_config/polybar/config.ini.tmpl index 88d6222..18b7fd0 100644 --- a/dot_config/polybar/config.ini.tmpl +++ b/dot_config/polybar/config.ini.tmpl @@ -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