diff --git a/files/polybar.ini b/files/polybar.ini index 009e324..46573c3 100644 --- a/files/polybar.ini +++ b/files/polybar.ini @@ -23,7 +23,7 @@ font-1 = "FontAwesome5FreeSolid:size=8;2" modules-left = i3 xwindow modules-center = date -modules-right = player_mpris_tail memory cpu pulseaudio power-menu +modules-right = player_mpris_tail memory cpu pulseaudio {% if ansible_fqdn == "TOO-Laptop" %}wattage battery{% endif %} power-menu module-margin = 2 @@ -112,3 +112,31 @@ menu-0-1 = Restart menu-0-1-foreground = #0F0 label-separator = " | " expand-right = false + +[module/battery] +type = internal/battery +full-at = 100 +poll-interval = 1 +time-format = %H:%M +ramp-capacity-0 =  +ramp-capacity-1 =  +ramp-capacity-2 =  +ramp-capacity-3 =  +ramp-capacity-4 =  +animation-charging-framerate = 500 +animation-charging-0 = ${self.ramp-capacity-0} +animation-charging-1 = ${self.ramp-capacity-1} +animation-charging-2 = ${self.ramp-capacity-2} +animation-charging-3 = ${self.ramp-capacity-3} +animation-charging-4 = ${self.ramp-capacity-4} +animation-discharging-framerate = ${self.animation-charging-framerate} +format-charging = +format-discharging = +label-discharging = %percentage%% (%time%) + +[module/wattage] +type = internal/battery +full-at = ${module/battery.full-at} +label-discharging =  %consumption%W +label-charging =  %consumption%W +poll-interval = ${module/battery.poll-interval}