aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2022-06-19 17:31:45 +0300
committerJoursoir <chat@joursoir.net>2022-06-19 17:31:45 +0300
commit0c35ee41e6fe8a1ac63f75559fb6936a87e2894e (patch)
tree69a4a19fceb2e12348195e2d8cad1946687911dc
parente4bc737af92267d070d8c98b2fc4a86a686ad798 (diff)
downloaddotfiles-0c35ee41e6fe8a1ac63f75559fb6936a87e2894e.tar.gz
dotfiles-0c35ee41e6fe8a1ac63f75559fb6936a87e2894e.tar.bz2
dotfiles-0c35ee41e6fe8a1ac63f75559fb6936a87e2894e.zip
dotconfig/polybar: add a backlight module
-rw-r--r--dotconfig/polybar/config2
-rw-r--r--dotconfig/polybar/modules49
2 files changed, 50 insertions, 1 deletions
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:
+ ; <label> (default)
+ ; <ramp>
+ ; <bar>
+ format = <ramp><label>
+ format-overline = ${color.background}
+ format-underline = ${color.background}
+
+ ; Available tokens:
+ ; %percentage% (default)
+ label = %percentage%%
+ label-background = ${color.background-alt}
+ label-padding = 1
+
+ ; Only applies if <ramp> is used
+ ramp-0 = 
+ ramp-1 = 
+ ramp-2 = 
+ ramp-3 = 
+ ramp-4 = 
+ ramp-background = ${color.lime}
+ ramp-padding = 1
+
[module/battery]
type = internal/battery