Skip to content

Instantly share code, notes, and snippets.

@fzerorubigd
Created August 23, 2018 10:06
Show Gist options
  • Select an option

  • Save fzerorubigd/79f1f45353fc37b3ee11effa2cb6bf28 to your computer and use it in GitHub Desktop.

Select an option

Save fzerorubigd/79f1f45353fc37b3ee11effa2cb6bf28 to your computer and use it in GitHub Desktop.
#!/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