Difference between revisions of "Talk:Backlight"

From ArchWiki
Jump to: navigation, search
(xbacklight workaround: re)
 
(21 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== <s> Permission </s> ==
+
== New kernel parameters ==
I just wanted to add that echo and > resulted in permission denied on my sistem, for that I would suggest using pipe and tee like "echo 5 | sudo tee /sys/class/backlight/acpi_video0/brightness" which works well. If combined with passwordless sudo it can be used to automate brightness setting upon login. (Didn't want to edit the actual page without any experience) [[User:Szebenyib|Szebenyib]] ([[User talk:Szebenyib|talk]]) 20:34, 7 June 2013 (UTC)
+
 
: {{ic|#}} means command should be run using root. See [[Help:Reading]] and [[Help:Style]].
+
As of version 4.1 the "video.use_native_backlight=1" is now obsolete and ignored by the kernel.
 +
 
 +
The new parameter is "acpi_backlight=[video|vendor|native|none]" [1]
 +
 
 +
I will go ahead and change this section in a few hours if there are no objections.
 +
 
 +
[1] https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=87521e16a7abbf3fa337f56cb4d1e18247f15e8a
 +
 
 +
[[User:Head on a Stick|Head on a Stick]] ([[User talk:Head on a Stick|talk]]) 10:21, 4 October 2015 (UTC)
 +
 
 +
:+1, latest supported kernel version on Arch is 4.1 so articles should be updated accordingly. -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 10:46, 4 October 2015 (UTC)
 +
 
 +
== xbacklight workaround ==
 +
 
 +
Quick and dirty script to emulate xbacklight to when it fails to recognize your video card.
 +
Works on Samsung Activ Book 9 lite with a (radeon_bl0) card.
 +
<pre>
 +
#!/bin/bash
 +
# It assumes only one directory in /sys/class/backlight/, edit if necessary!
 +
 
 +
MAX=$(</sys/class/backlight/*/max_brightness)
 +
CUR=$(</sys/class/backlight/*/brightness)
 +
NEW=$1
 +
 
 +
case ${1:0:1} in
 +
  [-+])
 +
    NEW=$[ $CUR * 100 / $MAX ${1:0:1} ${1:1} ]
 +
    ;;
 +
  [0-9])
 +
    ;;
 +
  *)
 +
    echo usage: $0 [+-]brigthness_percentage
 +
    exit -1
 +
esac
 +
 
 +
echo $[ $NEW * $MAX / 100 ] | sudo tee /sys/class/backlight/*/brightness > /dev/null && echo $NEW
 +
</pre>
 +
May be useful to add a sudo nopasswod entry also:
 +
 
 +
<pre>
 +
%wheel ALL=(ALL) NOPASSWD: /usr/bin/tee /sys/class/backlight/[[\:alpha\:]]*/brightness
 +
</pre>
 +
{{Unsigned| 15:16, 19 May 2016‎|Fmatheus}}
 +
:Why not use [[Acpid#Enabling_backlight_control]] ? -- [[User:Alad|Alad]] ([[User talk:Alad|talk]]) 13:25, 19 May 2016 (UTC)
 +
 
 +
::Good reference. But, for some reason my radeon card (Temash HD 8250/8280G) does not shows up as acpi_video0, so I dont know how to do that, but will try mess with 'acpi_backlight' kernel parameter and see if it works. -- [[User:Fmatheus|Fmatheus]] ([[User talk:Fmatheus|talk]]) 23:49, 19 May 2016 (UTC)
 +
 
 +
:::And what does it shows up as? You've already used {{ic|*}} instead of {{ic|acpi_video0}} in the paths, so I would have guessed that this is a trivial change... -- [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 07:22, 20 May 2016 (UTC)
 +
 
 +
::::Good point, in this sense my script is analogous to /etc/acpi/handlers/bl, the diference been the card name (radeon_bl0). I create it as a xbacklight replacement since it does not recognize this card. I not using acpid to handle the special keys (did hardcoded in dwm :), but would be nice to have a package to handle that out of the box, than works also in console! -- [[User:Fmatheus|Fmatheus]] ([[User talk:Fmatheus|talk]]) 12:09, 20 May 2016 (UTC)
 +
 
 +
:::::There is [[Backlight#acpilight]] :) [[User:Lahwaacz|Lahwaacz]] ([[User talk:Lahwaacz|talk]]) 12:16, 20 May 2016 (UTC)

Latest revision as of 12:16, 20 May 2016

New kernel parameters

As of version 4.1 the "video.use_native_backlight=1" is now obsolete and ignored by the kernel.

The new parameter is "acpi_backlight=[video|vendor|native|none]" [1]

I will go ahead and change this section in a few hours if there are no objections.

[1] https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=87521e16a7abbf3fa337f56cb4d1e18247f15e8a

Head on a Stick (talk) 10:21, 4 October 2015 (UTC)

+1, latest supported kernel version on Arch is 4.1 so articles should be updated accordingly. -- Alad (talk) 10:46, 4 October 2015 (UTC)

xbacklight workaround

Quick and dirty script to emulate xbacklight to when it fails to recognize your video card. Works on Samsung Activ Book 9 lite with a (radeon_bl0) card.

#!/bin/bash
# It assumes only one directory in /sys/class/backlight/, edit if necessary!

MAX=$(</sys/class/backlight/*/max_brightness)
CUR=$(</sys/class/backlight/*/brightness)
NEW=$1

case ${1:0:1} in
  [-+])
    NEW=$[ $CUR * 100 / $MAX ${1:0:1} ${1:1} ]
    ;;
  [0-9])
    ;;
  *)
    echo usage: $0 [+-]brigthness_percentage
    exit -1
esac

echo $[ $NEW * $MAX / 100 ] | sudo tee /sys/class/backlight/*/brightness > /dev/null && echo $NEW

May be useful to add a sudo nopasswod entry also:

%wheel ALL=(ALL) NOPASSWD: /usr/bin/tee /sys/class/backlight/[[\:alpha\:]]*/brightness

—This unsigned comment is by Fmatheus (talk) 15:16, 19 May 2016‎. Please sign your posts with ~~~~!

Why not use Acpid#Enabling_backlight_control ? -- Alad (talk) 13:25, 19 May 2016 (UTC)
Good reference. But, for some reason my radeon card (Temash HD 8250/8280G) does not shows up as acpi_video0, so I dont know how to do that, but will try mess with 'acpi_backlight' kernel parameter and see if it works. -- Fmatheus (talk) 23:49, 19 May 2016 (UTC)
And what does it shows up as? You've already used * instead of acpi_video0 in the paths, so I would have guessed that this is a trivial change... -- Lahwaacz (talk) 07:22, 20 May 2016 (UTC)
Good point, in this sense my script is analogous to /etc/acpi/handlers/bl, the diference been the card name (radeon_bl0). I create it as a xbacklight replacement since it does not recognize this card. I not using acpid to handle the special keys (did hardcoded in dwm :), but would be nice to have a package to handle that out of the box, than works also in console! -- Fmatheus (talk) 12:09, 20 May 2016 (UTC)
There is Backlight#acpilight :) Lahwaacz (talk) 12:16, 20 May 2016 (UTC)