From e4bc737af92267d070d8c98b2fc4a86a686ad798 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Fri, 17 Jun 2022 15:58:13 +0300 Subject: dotconfig/polybar: add a battery module --- dotconfig/polybar/config | 2 +- dotconfig/polybar/modules | 94 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 1 deletion(-) (limited to 'dotconfig/polybar') diff --git a/dotconfig/polybar/config b/dotconfig/polybar/config index 178d800..3c3bdae 100644 --- a/dotconfig/polybar/config +++ b/dotconfig/polybar/config @@ -119,7 +119,7 @@ include-file = ~/.config/polybar/modules ; Modules modules-left = sep workspaces sep network sep cpu_bar sep memory_bar modules-center = title - modules-right = pulseaudio sep keyboard sep date sep + modules-right = battery sep pulseaudio sep keyboard sep date sep [global/wm] margin-top = 0 diff --git a/dotconfig/polybar/modules b/dotconfig/polybar/modules index 2de20c1..1455a33 100644 --- a/dotconfig/polybar/modules +++ b/dotconfig/polybar/modules @@ -57,6 +57,100 @@ ; Right click click-right = pavucontrol +[module/battery] + type = internal/battery + + ; This is useful in case the battery never reports 100% charge + full-at = 99 + + ; Use the following command to list batteries and adapters: + ; $ ls -1 /sys/class/power_supply/ + battery = BAT1 + adapter = ACAD + + ; 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. + poll-interval = 5 + + ; see "man date" for details on how to format the time string + ; NOTE: if you want to use syntax tags here you need to use %%{...} + time-format = %H:%M + + ; Available tags: + ; (default) + ; + ; + ; + format-charging = + format-charging-prefix =  + format-charging-prefix-background = ${color.green} + format-charging-prefix-padding = 1 + format-charging-overline = ${color.background} + format-charging-underline = ${color.background} + + ; Available tags: + ; (default) + ; + ; + ; + format-discharging = + format-discharging-overline = ${color.background} + format-discharging-underline = ${color.background} + + ; Available tags: + ; (default) + ; + ; + format-full = + format-full-prefix =  + format-full-prefix-background = ${color.red} + format-full-prefix-padding = 1 + format-full-overline = ${color.background} + format-full-underline = ${color.background} + + ; Available tokens: + ; %percentage% (default) + ; %time% + ; %consumption% (shows current charge rate in watts) + label-charging = %percentage%% + label-charging-background = ${color.background-alt} + label-charging-padding = 1 + + ; Available tokens: + ; %percentage% (default) + ; %time% + ; %consumption% (shows current discharge rate in watts) + label-discharging = %percentage%% + label-discharging-background = ${color.background-alt} + label-discharging-padding = 1 + + ; Available tokens: + ; %percentage% (default) + label-full = Full + label-full-background = ${color.background-alt} + label-full-padding = 1 + + ; Only applies if is used + ramp-capacity-0 =  + ramp-capacity-1 =  + ramp-capacity-2 =  + ramp-capacity-3 =  + ramp-capacity-4 =  + ramp-capacity-background = ${color.pink} + ramp-capacity-padding = 1 + + ; Only applies if is used + animation-charging-0 = + animation-charging-1 = + + ; Framerate in milliseconds + animation-charging-framerate = 750 + [module/date] type = internal/date -- cgit v1.2.3-18-g5258