View Single Post
Win7Mac's Avatar
Community Council | Posts: 664 | Thanked: 1,648 times | Joined on Apr 2012 @ Hamburg
#535
So it turns out that the 3-color-% script quite often suffers a timeout. Thanks to slarti this is fixed now:
Code:
#!/bin/sh
status=$(qdbus --system org.freedesktop.Hal /org/freedesktop/Hal/devices/bme org.freedesktop.Hal.Device.GetProperty battery.charge_level.percentage)
if [[ $status -ge 50 ]]
then printf "{{green}} $status"
fi
if [[ $status -ge 25 && $status -le 49 ]]
then printf "{{yellow}} $status"
fi
if [[ $status -le 24 ]]
then printf "{{red}} $status"
fi
This script utilizes qdbus instead of lshal and is much faster.
It also works while charging.
Nice, thanks!

[EDIT] and its complete now, too...
__________________
Nokia 5110 > 3310 > 6230 > N70 > N9 BLACK 64GB
Hildon Foundation Board member
Maemo Community e.V. co-creator, founder and director since Q4/2016
Current Maemo Community Council member

Last edited by Win7Mac; 2013-01-19 at 20:52.
 

The Following User Says Thank You to Win7Mac For This Useful Post: