From 5096cf2655aa8b0c303ebe18db34711a037513ab Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Mon, 19 Feb 2024 23:25:45 +0100 Subject: [PATCH] polybar: Add backlight and battery modules --- home/alex/services/polybar/config.ini | 58 ++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/home/alex/services/polybar/config.ini b/home/alex/services/polybar/config.ini index 2cedc8a..112a45f 100644 --- a/home/alex/services/polybar/config.ini +++ b/home/alex/services/polybar/config.ini @@ -52,7 +52,7 @@ font-0 = monospace;2 modules-left = xworkspaces xwindow modules-center = systray -modules-right = filesystem pulseaudio xkeyboard memory cpu wlan eth date +modules-right = filesystem pulseaudio xkeyboard memory cpu battery wlan eth backlight date cursor-click = pointer cursor-scroll = ns-resize @@ -73,6 +73,62 @@ type = internal/tray format-margin = 8pt tray-spacing = 16pt +[module/battery] +type = internal/battery + +; This is useful in case the battery never reports 100% charge +; Default: 100 +full-at = 99 + +; format-low once this charge percentage is reached +; Default: 10 +; New in version 3.6.0 +low-at = 10 + +; Use the following command to list batteries and adapters: +; $ ls -1 /sys/class/power_supply/ +battery = BAT0 +adapter = ADP0 + +; 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 + +[module/backlight] +type = internal/xbacklight + +; XRandR output to get get values from +; Default: the monitor defined for the running bar +;output = DP-4 + +; Create scroll handlers used to set the backlight value +; Default: true +enable-scroll = true + +; Available tags: +;