Created
January 1, 2012 15:23
-
-
Save smathot/1547591 to your computer and use it in GitHub Desktop.
Script to fix backlight issue (dark screen) for HP g62 laptop on Ubuntu 11.10
This file contains hidden or 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
| #!/bin/bash | |
| # Fix the backlight issue on Ubuntu 11.10 for | |
| # a HP G62 laptop. Add this script to the startup | |
| # applications. In addition, make sure to make | |
| # /sys/class/backlight/intel_backlight | |
| # world-writable (chmod 777), for example | |
| # in /etc/rc.local | |
| # | |
| # Examples: | |
| # | |
| # Set backlight to max: | |
| # ./backlight | |
| # | |
| # Sleep for 10 seconds before setting backlight | |
| # to max: | |
| # ./backlight sleep 10 | |
| # | |
| # Turn up backlight: | |
| # ./backlight up | |
| # | |
| # Turn down backlight: | |
| # ./backlight down | |
| LOC=/sys/class/backlight/intel_backlight | |
| if [ $# == 0 ]; then | |
| echo 'MAX' | |
| cat $LOC/max_brightness > $LOC/brightness | |
| elif [ $1 == 'sleep' ]; then | |
| sleep $2 | |
| echo 'MAX' | |
| cat $LOC/max_brightness > $LOC/brightness | |
| elif [ $1 == 'up' ]; then | |
| echo $[ `cat $LOC/brightness` + 256 ] > $LOC/brightness | |
| echo 'UP' | |
| elif [ $1 == 'down' ]; then | |
| echo $[ `cat $LOC/brightness` - 256 ] > $LOC/brightness | |
| echo 'DOWN' | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment