You are not logged in.
Hello, the situation is as follows:
My (Toshiba Z30) backlight keys toggle the XFCE-brightness control popup, but they don't control the display brightness.
I found out why: they control /sys/class/backlight/toshiba/brightness instead of /sys/class/backlight/intel_backlight/brightness. I wasn't able to change that, although testing the kernel parameters acpi_backlight=vendor and acpi_osi='!Windows 2012'. That tip (bottom of the page) given in the arch wiki had no effect OR didn't even let me boot when I tried to adjust the BusID to the output of lspci...
So I got another solution, these selfmade scripts:
/usr/local/bin/darker
____________________________
#!/bin/bash
CURR=`cat /sys/class/backlight/intel_backlight/brightness`
MIN=3
NEW=$(($CURR-50))
if [ $NEW -lt 5 ]
then
NEW=5
fi
echo $NEW > /sys/class/backlight/intel_backlight/brightness
and
/usr/local/bin/brighter
____________________________
#!/bin/bash
CURR=`cat /sys/class/backlight/intel_backlight/brightness`
MAX=`cat /sys/class/backlight/intel_backlight/max_brightness`
NEW=$(($CURR+50))
if [ $NEW -gt $MAX ]
then
NEW=$MAX
fi
echo $NEW > /sys/class/backlight/intel_backlight/brightness
which work.
Assigning these scripts to keys also works with "sudo darker" / "sudo brighter" and adding them via visudo.
The only thing missing to make it perfect, is the combination:
Using the default brightness keys including the XFCE onscreen notification/popup binded to those scripts. (Just assigning to the brightness keys would make me lose the on screen notifiaction/popup...)
So how is that possible, has anyone an idea?
Last edited by Carl Karl (2014-10-14 15:21:14)
Offline
notify-send is one option.
Offline
Thanks, that's quite good, except that multiple key-presses lead to multiple notification popups which is not sooo nice bad acceptable. (And as this is run by root, a sudo xfce4-notifyd-config is necessary to configure the notification.)
for reference:
/usr/local/bin/brighter
____________________________
#!/bin/bash
CURR=`cat /sys/class/backlight/intel_backlight/brightness`
MAX=`cat /sys/class/backlight/intel_backlight/max_brightness`
NEW=$(($CURR+20))
if [ $NEW -gt $MAX ]
then
NEW=$MAX
fi
echo $NEW > /sys/class/backlight/intel_backlight/brightness
notify-send "Backlight $(($NEW*100/$MAX)) %"
/usr/local/bin/darker
__________________________
#!/bin/bash
CURR=`cat /sys/class/backlight/intel_backlight/brightness`
MIN=3
MAX=`cat /sys/class/backlight/intel_backlight/max_brightness`
NEW=$(($CURR-20))
if [ $NEW -lt 5 ]
then
NEW=5
fi
echo $NEW > /sys/class/backlight/intel_backlight/brightness
notify-send "Backlight $(($NEW*100/$MAX)) %"
So any idea how to avoid these multiple notifications? notify-send --help wasn't helpful for me.
Offline
A couple of pointers:
if you are using bash, you should use `[[` over `[`: it is more resilient.
use $(..) rather than backticks
spare the feline: max=$(</sys/class/backlight/intel_backlight/brightness)
you don't need the `$` in the arithmetic expression: $(( curr + 20 ))
Have you tried lowering the timeout for the notifications?
Offline
Thanks for that information +
Have you tried lowering the timeout for the notifications?
yes, the parameter --expire-time=(value in ms) seems to have no effect, at least if it is shorter than the one defined in xfce4-notifyd-config. But as these are my only notifications by root, setting by sudo xfce4-notifyd-config is also acceptable.... ...except of no shorter times than 1s can be set. So painting the screen full of notifications is still possible. ;-)
Offline
You don't need to use sudo: use xbacklight. See https://bitbucket.org/jasonwryan/shiv/s … brightness
Offline
nope. E.g. xbacklight -inc 40 has exactly no effect for me.
Offline
OK, xbacklight works after defining:
/etc/X11/xorg.conf.d/30-backlight.conf
____________________________________________
Section "Device"
Identifier "Device0"
Driver "intel"
Option "Backlight" "intel_backlight"
EndSection
Offline
OK, I had time to include the tips, so now its:
/usr/local/bin/darker
________________________
#!/bin/bash
CURR=$(</sys/class/backlight/intel_backlight/brightness)
MIN=3
MAX=$(</sys/class/backlight/intel_backlight/max_brightness)
NEW=$((CURR-20))
if [[ $NEW -lt $MIN ]]
then
NEW=$MIN
fi
echo $NEW > /sys/class/backlight/intel_backlight/brightness
notify-send "Backlight $((NEW*100/MAX)) %"
/usr/local/bin
________________________
#!/bin/bash
CURR=$(</sys/class/backlight/intel_backlight/brightness)
MAX=$(</sys/class/backlight/intel_backlight/max_brightness)
NEW=$((CURR+20))
if [[ $NEW -gt $MAX ]]
then
NEW=$MAX
fi
echo $NEW > /sys/class/backlight/intel_backlight/brightness
notify-send "Backlight $((NEW*100/MAX)) %"
Let's say it's good enough that way. It works and the multiple notifications look sort of funny... ;-)
(And I don't mind using sudo, because that way I have a way to set a shorter fadeout just for these notifiactions.)
Thanks again and solved.
Offline