-
-
Save PhDP/6085889 to your computer and use it in GitHub Desktop.
Ruby script to set the brightness on my Dell XPS (the normal way fails after Ubuntu 13.04).
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
#!/usr/bin/env ruby | |
if ARGV.length != 1 then | |
puts 'Provide a single argument between 0.1 (nearly black) and 1.0 (max brigthness).' | |
exit(42) | |
end | |
b = ARGV[0].to_f | |
b = (if b < 0.1 then 0.1 elsif b > 1.0 then 1.0 else b end).to_s | |
puts 'Setting brightness to ' + b | |
exec 'xrandr --output eDP1 --brightness ' + b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment