Created
February 14, 2020 20:52
-
-
Save anibalardid/21230e4c6bd120e8b5767fc7c256a4a0 to your computer and use it in GitHub Desktop.
brightnes keyboard backlight in ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Probar encendido: | |
echo 3 > /sys/class/leds/asus::kbd_backlight/brightness | |
Probar apagado: | |
echo 0 > /sys/class/leds/asus::kbd_backlight/brightness | |
(1)Crear 2 scripts: | |
nano /home/anibal/leds_down.sh | |
Code: | |
#!/bin/bash | |
brightness=$(cat "/sys/class/leds/asus::kbd_backlight/brightness") | |
a=$((brightness-1)) | |
if [ "$brightness" -gt 0] | |
then | |
echo $a >> /sys/class/leds/asus\:\:kbd_backlight/brightness | |
fi | |
then create the script to raise the brightness: | |
Code: | |
nano /home/anibal/leds_up.sh | |
with this code: | |
Code: | |
#!/bin/bash | |
brightness=$(cat "/sys/class/leds/asus::kbd_backlight/brightness") | |
a=$((brightness+1)) | |
if [ "$brightness" -lt 3] | |
then | |
echo $a >> /sys/class/leds/asus\:\:kbd_backlight/brightness | |
fi | |
now change their permissions so that they are executable: | |
Code: | |
chmod +x /home/anibal/leds_down.sh | |
chmod +x /home/anibal/leds_up.sh | |
edit the file rc.local and add a line that will permanently give all users the ability to change the file on every boot: | |
Code: | |
sudo nano /etc/rc.local | |
specifically, enter this line | |
Code: | |
chmod 666 /sys/class/leds/asus\:\:kbd_backlight/brightness | |
exit 0 | |
(2) Next we need to remap the keyboard so that pressing the function keys will trigger the scripts. To do that we need to get a program called xbindkeys (and its configuration GUI, xbindkeys-config): | |
Code: | |
sudo apt-get install xbindkeys xbindkeys-config | |
create a configuration file (and load a few default settings into it): | |
Code: | |
xbindkeys -d > /home/yourname/.xbindkeysrc | |
Now launch the xbindkeys configuration GUI from a terminal: | |
Code: | |
xbindkeys-config | |
Link: | |
https://ubuntuforums.org/showthread.php?t=2185305 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment