2015-06-05 01:04:15 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
HEADER_COLOR="#A0A57E"
|
|
|
|
|
|
|
|
header(){
|
2015-06-08 03:03:44 +02:00
|
|
|
echo "%{F$HEADER_COLOR}$1%{F-}"
|
2015-06-05 01:04:15 +02:00
|
|
|
}
|
|
|
|
|
2015-06-10 08:33:16 +02:00
|
|
|
tag() {
|
|
|
|
echo -n "%{F#HEADER_COLOR}$1:${F-}%{r}"
|
|
|
|
}
|
|
|
|
|
2015-06-05 01:04:15 +02:00
|
|
|
### 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"
|
2015-06-10 08:33:16 +02:00
|
|
|
#mpc current -f "$(header Artist:) %artist%\n$(header Album:) %album%\n$(header Title:) %title%"
|
|
|
|
tag "Artist"; mpc current -f "%artist%"
|
|
|
|
tag "Album"; mpc current -f "%album%"
|
|
|
|
tag "Title"; mpc current -f "%title%"
|
2015-06-05 01:04:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
### Battery info
|
|
|
|
battery() {
|
|
|
|
header "Battery"
|
|
|
|
acpi -abt
|
|
|
|
}
|
|
|
|
|
|
|
|
### Clock info
|
|
|
|
clock() {
|
|
|
|
header "Clock"
|
|
|
|
date +"%A %d.%m.%Y"
|
|
|
|
date +"$(header KW:) %V"
|
|
|
|
}
|
|
|
|
|
|
|
|
### RUN CODE
|
|
|
|
|
2015-06-08 03:09:30 +02:00
|
|
|
if [ "$1" == "kill" ]; then
|
|
|
|
pkill popup
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2015-06-05 01:04:15 +02:00
|
|
|
if [ $# -lt 2 ]; then
|
2015-06-08 03:09:30 +02:00
|
|
|
echo "$0 <display> <x>: Run bar"
|
|
|
|
echo "$0 kill: Kill bar"
|
2015-06-05 01:04:15 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-06-08 03:03:44 +02:00
|
|
|
$1 | popup -g 300x10+$2+20 -B "#88000000"
|
|
|
|
|