i own a Thinkpad yoga. This model has only function keys for increase or decrease the backlight. Minimum backlight does not switch the backlight completely off. So i use xbacklight to set the backlight to 0 percent. I made a shortcut on two unused functionkeys to turn the backlight to 0 and 50 percent. Now i want to merge these two functions in one key.
My idea about it:
read the value of the value, that xbacklight gives me, when its 0 then switch the backlight to a specific percentage, else, turn it to 0 (on and off)
I tried to write a script, but all my tries to save the output of the xbacklight command in a variable failed.
Thanks in advance!
#!/bin/bash
backlight= <-- in this variable i want to save the output of the xbacklight command
if [ $backlight == 0 ];
then
xbacklight -set 50
else
xbacklight -set 0
fi