xeno/awesome_bar.sh
Stefan Ritter 380d3abf72 Unspectacular:
* Back to awesome
* Fixed IP Script
2009-06-10 15:17:46 +02:00

33 lines
889 B
Bash
Executable file

#!/bin/zsh
SCREEN=0
func_power() {
if [ -e /proc/acpi/battery/BAT0/info ]; then
CAP=$(grep full /proc/acpi/battery/BAT0/info | awk '{print $4}')
REM=$(grep remaining /proc/acpi/battery/BAT0/state | awk '{print $3}')
STATE=$(($REM * 100 / $CAP))"%"
echo $STATE
else
echo "No Battery"
fi
}
func_mem() {
TOT=$(free -m | grep Mem | awk '{print $2}')
USE=$(free -m | grep buffers/cache | awk '{print $3}')
MEM=$(($USE * 100 / $TOT))
echo $MEM
}
while true; do
echo $SCREEN widget_tell topbar power text " `func_power` " | awesome-client
echo $SCREEN widget_tell topbar wlan text " $(ip r | awk '{print $9}' | head -n 1) " | awesome-client
echo $SCREEN widget_tell topbar clock text " `date +"%x %T"` " | awesome-client
echo $SCREEN widget_tell topbar hostname text " `hostname` " | awesome-client
sleep 1
done
# vim: set tw=0 ts=4: