Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- export DISPLAY=:0.0
- a=`acpi -b`
- len=${#a}
- if [ $len -eq 47 ];then
- prcnt=${a:24:2}
- if [ $prcnt -gt 80 ];then
- echo "Battery:$prcnt%"| osd_cat -p top -A center -f lucidasanstypewriter-bold-12 -c green -d 59
- elif [ $prcnt -gt 60 ];then
- echo "Battery:$prcnt%"| osd_cat -p top -A center -f lucidasanstypewriter-bold-12 -c blue -d 59
- elif [ $prcnt -gt 40 ];then
- echo "Battery:$prcnt%"| osd_cat -p top -A center -f lucidasanstypewriter-bold-12 -c yellow -d 59
- elif [ $prcnt -gt 15 ];then
- echo "Battery:$prcnt%"| osd_cat -p top -A center -f lucidasanstypewriter-bold-12 -c orange -d 59
- else
- echo "Battery:$prcnt%"| osd_cat -p top -A center -f lucidasanstypewriter-bold-12 -c red -d 59
- fi
- else
- prcnt=${a:21:2}
- if [ $prcnt -gt 80 ];then
- echo "Battery:$prcnt%"| osd_cat -p top -A center -f lucidasanstypewriter-bold-12 -c green -d 59
- elif [ $prcnt -gt 60 ];then
- echo "Battery:$prcnt%"| osd_cat -p top -A center -f lucidasanstypewriter-bold-12 -c blue -d 59
- elif [ $prcnt -gt 40 ];then
- echo "Battery:$prcnt%"| osd_cat -p top -A center -f lucidasanstypewriter-bold-12 -c yellow -d 59
- elif [ $prcnt -gt 15 ];then
- echo "Battery:$prcnt%"| osd_cat -p top -A center -f lucidasanstypewriter-bold-12 -c orange -d 59
- else
- echo "Battery:$prcnt%"| osd_cat -p top -A center -f lucidasanstypewriter-bold-12 -c red -d 59
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement