Arch (xbacklight): No outputs have backlight property [closed]
Asked Answered
A

9

20

I have two folders in my /sys/class/backlight:

1> acpi_video0 2> intel_backlight

The intel_backlight is useless because I can use the following command to adjust brightness in acpi_video0 (I'm running Nvidia drivers):

e.g: echo 50 > /sys/class/backlight/acpi_video0/brightness

Problem: Using xbacklight -inc +5 outputs: "No outputs have backlight property" so I need to get it to use acpi_video0

So far, I have tried to rm the intel_backlight folder completely with no luck (using both sudo and changing permission to 777 recursively).

I just wanna be able to hotkey the xbacklight to increment and decrement brightness. I can set brightness in acpi_video0 to a hard value using echo but don't know how to adjust it in increments.

Kindly advise further!

Regards :)

EDIT 1: (POSSIBLE ALTERNATIVE) For anyone with this problem in the future, install xcalib. (Setup: Arch Linux w/ i3 window manager)

yaourt -S xcalib

And the following hotkey assignment (i3 in my case) in the config file:

# Brightness control reset screen (100% brightness)
bindsym Mod1+Up exec xcalib -c
# Brightness control down
bindsym Mod1+Down exec xcalib -co 95 -a
Affection answered 26/5, 2014 at 8:54 Comment(6)
Have You specified ACPI_backlight=vendor in Your kernel-boot-parameters ? If not, try it. wiki.archlinux.org/index.php/backlightPiste
I read about that, I have ubuntu and arch on dual boot (i.e. auto-detected the arch install from updating grub within ubuntu post-installation). Would modifying my grub-config to add that (I believe that's what it wants us to do) affect the ubuntu boot process?Affection
Each OS has an own boot entry. Look, at grub.conf. There You should see, that if You pass kernel parameters to one entry, the other is unchanged. ( would be really bad, if this was not like it is ).Piste
Makes sense :) I'll definitely try that out and post back. Thanks for the help.Affection
Worked perfectly, thank you sir! I don't have 15 rep points yet as I am a new member but if and when I do, I shall vote you up (if that is infact how it works)Affection
Please add answer and mark it as accepted.Soaring
U
25

EDIT: I found this question because I had the same output error: no outputs have backlight property. light solved this with no further tinkering.

A better alternative to xcalib (which doesn't adjust backlight; won't save battery power): light available in community/light.

Usage

  • light -U 20 decrease backlight 20%
  • light -A 20 increase 20%
  • light -S 50 set backlight to 50%

Found here wiki.archlinux.org/index.php/backlight (thanks @icbytes).

Unbelieving answered 27/10, 2015 at 6:50 Comment(2)
Note: It will require sudo permissionsFerreira
This project is abandoned github.com/haikarainen/lightDendrite
T
10

Update as of December 2023 to add support for percents and automatically add read/write permission if needed.

I've replaced my xbacklight with the following script :

#!/usr/bin/env bash

set -euo pipefail

file="/sys/class/backlight/intel_backlight/brightness"
max_file="${file//brightness/max_brightness}"

if /usr/bin/xbacklight "$@" 2>/dev/null; then
    exit 0
fi

add_perm() {
    echo "Adding read/write permission (with sudo)"
    sudo chmod 766 "$file"
}
if ! [ -r "$file" ]; then
    echo "You don't have read permission"
    add_perm
fi

if ! [ -w "$file" ]; then
    echo "You don't have write permission"
    add_perm
fi

MIN=10
MAX="$(cat "$max_file")"
current=$(cat "$file")
new="$current"
cmd="$1"
val="$2"

# Convert percents to number
if grep '%' <<<"$val" --quiet; then
    pct="${val//%/""}"
    val="$(bc <<<"$pct*$MAX/100")"
fi

if [ "$cmd" = -inc ]; then
    new=$(( current + val ))
elif [ "$cmd" = -dec ]; then
    new=$(( current - val ))
elif [ "$cmd" = -set ]; then
    new=$(( val ))
fi
if [ "$new" -gt "$MAX" ]; then
    new="$MAX"
elif [ "$new" -lt "$MIN" ]; then
    new="$MIN"
fi
pct_value="$(bc -l <<<"$new/$MAX*100")"
printf "%.0f%%\n" "$pct_value"
echo "$new" > "$file"

you have to replace file by the file that you can find by using :

sudo find /sys/ -type f -iname 'brightness'

and you have to make sure that this file is writable : eg :

sudo chmod a+rw /sys/class/backlight/intel_backlight/brightness

Tilney answered 30/8, 2016 at 14:21 Comment(3)
Note: sudo find /sys/ -type f -iname "brightness" did not find the file for me. However, /sys/class/backlight/intel_backlight/brightness is correct in my case. I like this solution as it works in OpenSUSE Tumbleweed also -- I don't see light or light-git in the tumbleweed or pacman reposGroves
This solution worked for me on EndeavourOS on a Lenovo ThinkPad T470s as of December 2023.Eckart
Awesome, I've just updated the script to add percent support + support for the -set commandTilney
M
3

To solve similar issue on a fresh Arch install I decided to go with acpilight also available in AUR. Advertised as 'backward-compatibile replacement for xbacklight' it does not depend on X11 as such, works just as fine on Wayland and/or virtual console should such need arise.

After installation the regular user needs to be added to the 'video' group and a drop-in file for a very conservative udev rule neeeds to be created:.

**/etc/udev/rules.d/90-backlight.rules**

SUBSYSTEM=="backlight", ACTION=="add", \
  RUN+="/bin/chgrp video %S%p/brightness", \
  RUN+="/bin/chmod g+w %S%p/brightness"

On some laptops keyboard backlight control is also supported. For more information refer project's github gitlab page linked above.

Hope this helps I found acpilight very handy to setup and use.

NOTE: Python(3) dependent solution.

NOTE 2: At the heart of acpilight lays not much more than a simple python script that can easily be extracted.

Malvia answered 10/6, 2017 at 19:45 Comment(1)
This is a very elegant solution. The need of adding user(s) to the video group is essential.Ecg
C
2

To add to @edi9999 's great solution, this one works with percentages and it can set the limits

#!/bin/bash
MAX=661
MIN=10
set -e
file="/sys/class/backlight/intel_backlight/brightness"
current=$(cat "$file")
new="$current"
if [ "$2" != "" ]; then
    val=$(echo "$2*$MAX/100" | bc)
fi
if [ "$1" = "-inc" ]; then
    new=$(( current + $val ))
elif [ "$1" = "-dec" ]; then
    new=$(( current - $val ))
fi
if [ $new -gt $MAX ]; then
    new=$MAX
elif [ $new -lt $MIN ]; then
    new=$MIN
fi
printf "%.0f%%\n" $(echo "$new/$MAX*100" | bc -l)
echo $new > "$file"
Cass answered 30/8, 2018 at 11:16 Comment(0)
I
1

I've also faced the No outputs have backlight property issue when using xbacklight but stumbled on a simple fix, at least with Fedora 28 on a MacBook Pro 13,1.

While other solutions appear like they should work, I didn't need to install anything nor use any scripts. Hopefully this is applicable for other distros too given that I used the Arch Wiki to help me along:

https://wiki.archlinux.org/index.php/Backlight#ACPI talks about ls /sys/class/backlight/ and in my case, that shows acpi_video0@ and intel_backlight@.

With that, I tried intel_backlight, so I used cat /sys/class/backlight/intel_backlight/brightness to see what the current value was (39).

Using echo 50|sudo tee /sys/class/backlight/intel_backlight/brightness (type info tee for more details about tee) resulted in the backlight brightening - progress!

Now interestingly after doing this, the xbacklight -inc 10 and xbacklight -dec 10 commands started magically working without me doing anything else so I can now bind my keyboard's brightness keys to xbacklight - no further sudo commands or rules required.

Intra answered 13/7, 2018 at 14:4 Comment(0)
Z
1

I'm using openSUSE but it helped to get xbacklight working (again) when I installed the xf86-video-intel package. This included the xorg-x11 drivers for intel graphics card and other stuff like command line utilities. After installing it was possible to control the backlight with xbacklight.

Before that, my only option was to control the backlight only with root permissions via /sys/class/backlight/intel_backlight/brightness

Zomba answered 15/2, 2019 at 22:38 Comment(0)
Q
0

I finally fixed this and none of the online solutions that the original poster listed worked for me either. What did solve the problem was going to /etc/default/grub and in the line: GRUB_CMDLINE_LINUX_DEFAULT

Adding :

"acpi_osi="

But also do Not use "nomodeset" on it. Ppl added nomodeset originally to fix the software rendering issue, but this actually causes Linux to not recognize the Nvidia drivers.

Lastly make sure you go to the Linux Start Menu Driver Manager and update your Nvidia drivers to 430 or newer.

Quimby answered 29/7, 2019 at 22:35 Comment(4)
To make these GRUB_... settings stick, on Fedora 33, I have to run sudo grub2-mkconfig -o /boot/grub2/grub.cfg, then restart.Bobcat
And different entries in GRUB_CMDLINE_LINUX_DEFAULT are separated by spaces. So put a space before acpi_osi= if there are other values in the GR_CM_LI_DEF...Bobcat
acpi_osi= broke my bootloader. You can press e in the grub menu to edit the config, then delete acpi_osi= & that fixed it for me.Bobcat
DEFINITELY use GRUB_CMDLINE_LINUX_DEFAULT, not the GRUB_CMDLINE_LINUX which is likely already in your /etc/default/grub. the _DEFAULT only runs during normal boot, so you can still boot into recovery, fix /etc/default/grub, then run grub2-mkconfig -o /boot/grub2/grub.cfg again & have a corrected bootloader.Bobcat
X
0

After a recent kernel update the xbacklight stopped working on my laptop. (Kernel version 6.1+ apparently).

I had this message in dmesg:

i915 0000:00:02.0: [drm] Skipping intel_backlight registration

The folder /sys/class/backlight/intel_backlight was replaced with /sys/class/backlight/acpi_video0, which didn't work and broke xbacklight.

There was more info about this issue on Linuxquestions.org: thread1 , thread2

.

The issue was fixed by adding the kernel boot parameter acpi_backlight=native

(this made /sys/class/backlight/intel_backlight appear again)

Xmas answered 4/3, 2023 at 14:20 Comment(0)
D
0

What I've done, added to archwiki:

Usage Brightlight <-|+>:

#!/bin/bash

# sputnick.fr 2023

devvideo=$(xrandr | awk '$2 == "connected"{print $1;exit}')

if ! val=$(cat ~/.config/xrandr/brightness 2>/dev/null); then
    mkdir -p ~/.config/xrandr
    echo 0.90 > ~/.config/xrandr/brightness
    val=0.90
fi

case $1 in
    -) val="0$(bc <<< $val-0.05)"  ;;
    +) val="0$(bc <<< $val+0.05)"  ;;
esac

if ((${val#*.} <= 20 || ${val#*.} >= 100 )); then
    echo >&2 ERR
    exit 1
fi
Doggery answered 30/3, 2023 at 8:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.