diff --git a/README.md b/README.md index bc2b6ec..e96f9e8 100644 --- a/README.md +++ b/README.md @@ -324,21 +324,18 @@ Otherwise, alpine wiki describes how to configure WiFi using `iwd`. ### Backlight -**TODO 2024** - -``` -doas apk add light -doas micro /etc/udev/rules.d/backlight.rules ``` -add the following lines into backlight.rules to make it possible for all users in video group (not just superusers) to control backlight: -``` -ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="amdgpu_bl0", RUN+="/bin/chgrp video /sys/class/backlight/%k/brightness" -ACTION=="add", SUBSYSTEM=="backlight", KERNEL=="amdgpu_bl0", RUN+="/bin/chmod g+w /sys/class/backlight/%k/brightness" +doas apk add enlighten +doas rc-service udev restart ``` -and then + +and add the following lines to river config: + ``` -doas rc-service udev restart +riverctl map $mode None XF86MonBrightnessUp spawn "BACKLIGHT_DEVICE=amdgpu_bl1 enlighten +5%" +riverctl map $mode None XF86MonBrightnessDown spawn "BACKLIGHT_DEVICE=amdgpu_bl1 enlighten -5%" ``` + Backlight control with Fn+F5/F6 should work now. (`amdgpu_bl0` is specific for this laptop; value for others can be obtained from `/sys/class/backlight/`) diff --git a/dotfiles/.config/river/init b/dotfiles/.config/river/init index 11cbea3..de150f4 100755 --- a/dotfiles/.config/river/init +++ b/dotfiles/.config/river/init @@ -141,9 +141,9 @@ do riverctl map $mode None XF86AudioPrev spawn 'playerctl previous' riverctl map $mode None XF86AudioNext spawn 'playerctl next' - # Control screen backlight brighness with light (https://github.com/haikarainen/light) - riverctl map $mode None XF86MonBrightnessUp spawn "light -A 5 && light -G | cut -d'.' -f1 > $XDG_RUNTIME_DIR/wobpipebright" - riverctl map $mode None XF86MonBrightnessDown spawn "light -U 5 && light -G | cut -d'.' -f1 > $XDG_RUNTIME_DIR/wobpipebright" + # Control screen backlight brighness with enlighten (https://github.com/HalosGhost/enlighten) + riverctl map $mode None XF86MonBrightnessUp spawn "BACKLIGHT_DEVICE=amdgpu_bl1 enlighten +5%" + riverctl map $mode None XF86MonBrightnessDown spawn "BACKLIGHT_DEVICE=amdgpu_bl1 enlighten -5%" done # Set background and border color