configfiles/scripts/barinfo.sh

54 lines
882 B
Bash
Raw Normal View History

2015-06-05 01:04:15 +02:00
#!/bin/bash
HEADER_COLOR="#A0A57E"
header(){
echo "^fg($HEADER_COLOR)$1^fg()"
}
### Filesystem info
filesystem() {
header "Diskspace"
for d in / /boot; do
df -h $d | tail -n 1 | awk '{printf "%-15s%10s%10s/%s\n",$6, $5, $3, $2}'
done
}
### Network info
network() {
header "Network"
wicd-cli --status
}
### Music info
music() {
header "Music"
mpc current -f "$(header Artist:) %artist%\n$(header Album:) %album%\n$(header Title:) %title%"
}
### Battery info
battery() {
header "Battery"
acpi -abt
}
### Clock info
clock() {
header "Clock"
date +"%A %d.%m.%Y"
date +"$(header KW:) %V"
}
### RUN CODE
if [ $# -lt 2 ]; then
echo "$0 <display> <x>"
exit 1
fi
DATA=`$1`
LINES=$[ $(echo "$DATA" | wc -l)-1 ]
echo "$DATA" | dzen2 -p -e 'onstart=uncollapse;button1=exit' -x "$2" -y 20 -w 300 -l $LINES -ta left