Created
October 26, 2013 19:54
-
-
Save sasha1sum/7173748 to your computer and use it in GitHub Desktop.
Simple ruby script to print an audible bell when the battery is low on linux.
This file contains 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/ruby | |
$threshold = 20 | |
/Discharging, (\d+)/.match(`acpi`) do |v| | |
print "\a" if v[1].to_i < $threshold | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment