Advertisement
wolkchen

screen-backlight

Feb 23rd, 2023
105
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.38 KB | Source Code | 0 0
  1. #!/bin/sh
  2. val_in=$1
  3. val=$(cat /sys/class/backlight/nv_backlight/brightness)
  4.  
  5. case $val_in in
  6.         "dec") let val=${val}-10;;
  7.         "inc") let val=${val}+10;;
  8.         *) echo "ERROR" 1>&2 && exit 1
  9. esac  
  10.  
  11. if [ $val -lt 10 ]
  12. then
  13.         let val=10
  14. elif [ $val -gt 90 ]
  15. then
  16.         let val=90
  17. fi
  18.  
  19. echo $val | sudo tee /sys/class/backlight/nv_backlight/brightness
  20.  
Advertisement
Comments
  • wolkchen
    1 year
    # text 0.13 KB | 0 0
    1. Controls gnome-4 backlight. Place script in /usr/local/bin/ and run with `gnome-terminal -e "pkexec /usr/local/bin/backlight <dec | inc>"`
Add Comment
Please, Sign In to add comment
Advertisement