From 0c35ee41e6fe8a1ac63f75559fb6936a87e2894e Mon Sep 17 00:00:00 2001 From: Joursoir Date: Sun, 19 Jun 2022 17:31:45 +0300 Subject: dotconfig/polybar: add a backlight module --- dotconfig/polybar/config | 2 +- dotconfig/polybar/modules | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) (limited to 'dotconfig/polybar') diff --git a/dotconfig/polybar/config b/dotconfig/polybar/config index 3c3bdae..6010c5c 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 = battery sep pulseaudio sep keyboard sep date sep + modules-right = backlight sep battery sep pulseaudio sep keyboard sep date sep [global/wm] margin-top = 0 diff --git a/dotconfig/polybar/modules b/dotconfig/polybar/modules index 1455a33..f2c7776 100644 --- a/dotconfig/polybar/modules +++ b/dotconfig/polybar/modules @@ -57,6 +57,55 @@ ; Right click click-right = pavucontrol +[module/backlight] + type = internal/backlight + + ; xbacklight only works with Intel. Other drivers (e.g. Radeon) did not + ; add support for the RandR backlight property. + ;type = internal/xbacklight + + ; Use the following command to list available cards: + ; $ ls -1 /sys/class/backlight/ + card = amdgpu_bl0 + + ; Use the `/sys/class/backlight/.../actual-brightness` file + ; rather than the regular `brightness` file. + use-actual-brightness = true + + ; Enable changing the backlight with the scroll wheel + ; NOTE: This may require additional configuration on some systems. Polybar will + ; write to `/sys/class/backlight/${self.card}/brightness` which requires polybar + ; to have write access to that file. + ; DO NOT RUN POLYBAR AS ROOT. + ; The recommended way is to add the user to the + ; `video` group and give that group write-privileges for the `brightness` file. + ; See the ArchWiki for more information: + ; https://wiki.archlinux.org/index.php/Backlight#ACPI + enable-scroll = true + + ; Available tags: + ;