Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

keyboard backlight not working linux

#!/bin/bash
# Adjust the keyboard backlight level

shopt -s -o nounset

declare -i KBD_BACKLIGHT_MAX=`cat /sys/class/leds/asus::kbd_backlight/max_brightness`
declare -i KBD_BACKLIGHT_LEV=`cat /sys/class/leds/asus::kbd_backlight/brightness` 

# We need a parameter, etiher inc or dec
if [ $# -eq 0 ] ; then
   exit 192
fi 

case $1 in
-inc ) 
   # increasing:
   if [ ${KBD_BACKLIGHT_LEV} -lt ${KBD_BACKLIGHT_MAX}  ] ; then
      KBD_BACKLIGHT_LEV=${KBD_BACKLIGHT_LEV}+1
      echo ${KBD_BACKLIGHT_LEV} | tee /sys/class/leds/asus::kbd_backlight/brightness
   fi
   ;;
-dec )
   # decreasing:
   if [ ${KBD_BACKLIGHT_LEV} -gt 0 ] ; then
      KBD_BACKLIGHT_LEV=${KBD_BACKLIGHT_LEV}-1
      echo ${KBD_BACKLIGHT_LEV} | tee /sys/class/leds/asus::kbd_backlight/brightness
   fi
   ;;
esac

exit 192
Comment

PREVIOUS NEXT
Code Example
Shell :: hint: Waiting for your editor to close the file... need to run as root or suid 
Shell :: powershell write to fgile 
Shell :: remove the override manually with dpkg-statoverride 
Shell :: arch linux deepin compositor 
Shell :: powershell recursive copy skip if file already exists 
Shell :: how to analyse a git repo 
Shell :: transcode input to output with h264 720p with gpu 
Shell :: linux open calc from the terminal 
Shell :: LetsEncrypt use alias for acme-challenge directory 
Shell :: how to stop brute force attack aws ec2 
Shell :: Filter Up Hosts 
Shell :: is needed to run `file_system` for your system 
Shell :: powershell profile takes a long time to load 
Shell :: Install ppsspp Linux 
Shell :: how to remove git ssh from macbook 
Shell :: linux set global server name 
Shell :: multiple-gits 
Shell :: how to stash git yarn.lock 
Shell :: files still appear as modified after addition to .gitignore 
Shell :: install avogadro on ubuntu 
Shell :: Alternative to ctrl+R on linux 
Shell :: pre-recivice hook deline push gitlab 
Shell :: ffmpeg webp to webm 
Shell :: Ranges 1 
Shell :: jq show only certain fields 
Shell :: tcp test powershell 2.0 
Shell :: openssl command 
Shell :: installing dlib library on windows 10 
Shell :: awk command in linux 
Shell :: git move latest commit to new branch 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =