Created
August 23, 2018 10:06
-
-
Save fzerorubigd/79f1f45353fc37b3ee11effa2cb6bf28 to your computer and use it in GitHub Desktop.
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 | |
| X=$(acpi | grep -o "[1 ][0-9][0-9]%" | grep -o "[1 ][0-9][0-9]") | |
| Y="" | |
| if [ -n "`acpi --ac-adapter| grep 'on-line'`" ]; then | |
| Y="" | |
| else | |
| Y="DIS" | |
| fi; | |
| BAT="" | |
| COL="#00FF00" | |
| if [ "$X" -lt "20" ]; then | |
| BAT="" | |
| COL="#FF0000" | |
| elif [ "$X" -lt "40" ]; then | |
| BAT="" | |
| COL="#CDCD00" | |
| elif [ "$X" -lt "70" ];then | |
| BAT="" | |
| COL="#00CD00" | |
| elif [ "$X" -lt "90" ];then | |
| BAT="" | |
| COL="#00FF00" | |
| fi; | |
| echo "$Y-$BAT%$X" | |
| echo "$Y-$BAT%$X" | |
| echo "$COL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment