You are not logged in.

#1 2023-03-10 23:54:42

LittleSandra
Member
Registered: 2021-01-25
Posts: 86

[SOLVED] can't get "light" to change brightness in Wayland/Sway?

Dear all smile

In i3wm I had the following in my config

bindsym XF86MonBrightnessUp exec xbacklight -inc 5 # increase screen brightness
bindsym XF86MonBrightnessDown exec xbacklight -dec 5 # decrease screen brightness

which of course won't work with sway.

If I as root do this

# cat /sys/class/backlight/intel_backlight/max_brightness 
6818
# cat /sys/class/backlight/intel_backlight/brightness 
2218
# echo 3000 >  /sys/class/backlight/intel_backlight/brightness

then I can change the brightness.

But when I do

light -s sysfs/backlight/intel_backlight -T 0.72

the screen doesn't get darker.

Can anyone see what I am doing wrong?

Hugs
Sandra smile

Last edited by LittleSandra (2023-03-11 18:25:24)

Offline

#2 2023-03-11 00:04:35

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,471
Website

Re: [SOLVED] can't get "light" to change brightness in Wayland/Sway?

First, see the huge warning on the upstream page of the "light" project.  Then second, ask why in the world you would need such a program.  Add your user to the video group and just have a script echo values to your backlight file - here's mine:

#!/bin/sh

cd /sys/class/backlight/intel_backlight
read max < max_brightness
read cur < brightness
echo "[$max]sa [0]sb $cur $((max/20)) $1 d 0 >b d $max <a p" \
	| dc >> brightness 2>/dev/null

This can take as parameters "+", "-", or a number to increment, decrement, or set to a specific value.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2023-03-11 18:24:57

LittleSandra
Member
Registered: 2021-01-25
Posts: 86

Re: [SOLVED] can't get "light" to change brightness in Wayland/Sway?

Ok, that is really cool! Thanks a lot smile

Offline

Board footer

Powered by FluxBB