kf5ccd

bash

Jan 31st, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Written by Dalton Miller and Philip Robb
  4.  
  5. echo "Welcome to the Asus G75 Linux Backlight Script"
  6. if [ 'whoami' = root ]; then
  7. echo Please rerun the script using superuser permissions
  8. exit
  9. fi
  10.  
  11. function readNum {
  12. echo "Lets adjust that brightness on your Nvidia backlight"
  13. echo "What value would you like to have your backlight set on?"
  14. read bklght
  15. }
  16.  
  17. until [[ $bklght -gt 1 && $bklght -lt 100 ]]; do
  18. echo ""
  19. echo "Hmmm that doesn't see to be valid value"
  20. echo "You inputed $bklght"
  21. echo "Lets try this again between 1-100 idiot"
  22. echo ""
  23. readNum
  24. done
  25.  
  26. modprobe nvidiabl
  27. echo $bklght | tee -a /sys/class/backlight/nvidia_backlight/brightness
  28. echo "Your backlight is set to $bklght"
  29.  
  30. exit
Advertisement
Add Comment
Please, Sign In to add comment