You are not logged in.
Pages: 1
I'm trying to control monitor brightness from hotkeys. I have tryed to use brightnessctl package, but it has only printed current and max brightness without actually changing them.
I have tried to run it with and without sudo, and it hasn't worked:
brightnessctl -s 50%So, i have written a simple script, that modifies the brightness, which is working, but requires sudo:
#!/bin/zsh
delta=$1
brightness=$(cat /sys/class/backlight/intel_backlight/brightness)
max_brightness=$(cat /sys/class/backlight/intel_backlight/max_brightness)
new_brightness=${$((max_brightness*(delta/100.0) + brightness))%i}
limited_brightness=$(( new_brightness < 0 ? 0 : (new_brightness > max_brightness ? max_brightness : new_brightness) ))
echo $brightness $max_brightness $new_brightness $limited_brightness >> ~/scripts.log
printf "%.0f" $limited_brightness | sudo tee /sys/class/backlight/intel_backlight/brightness &Can I either modify my script to run it without needing sudo privileges, or somehow run this script from hyprland config with sudo privileges?
P.S.
I have tried to install xorg-xbacklight package, wich hasn't worked either, and then acpilight package, which did worked at least. But it still requires sudo to execute:
sudo xbacklight -10Last edited by EugeneS (2023-12-27 10:35:55)
Offline
Please read through https://bbs.archlinux.org/viewtopic.php?id=291364 and post back if you still can't figure things out.
Jin, Jîyan, Azadî
Offline
Problem was solved with brightnessctl - I was using it wrong. Proper command is:
brightnessctl set 50%+ Offline
Pages: 1