64 lines
1 KiB
Bash
Executable file
64 lines
1 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
HEADER_COLOR="#A0A57E"
|
|
|
|
header(){
|
|
echo "%{F$HEADER_COLOR}$1%{F-}"
|
|
}
|
|
|
|
tag() {
|
|
echo -n "%{F#HEADER_COLOR}$1:${F-}%{r}"
|
|
}
|
|
|
|
### 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%"
|
|
tag "Artist"; mpc current -f "%artist%"
|
|
tag "Album"; mpc current -f "%album%"
|
|
tag "Title"; mpc current -f "%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 [ "$1" == "kill" ]; then
|
|
pkill popup
|
|
exit 0
|
|
fi
|
|
|
|
if [ $# -lt 2 ]; then
|
|
echo "$0 <display> <x>: Run bar"
|
|
echo "$0 kill: Kill bar"
|
|
exit 1
|
|
fi
|
|
|
|
$1 | popup -g 300x10+$2+20 -B "#88000000"
|
|
|