2015-08-26 00:56:33 +02:00
|
|
|
buildClock() {
|
2015-08-26 12:42:05 +02:00
|
|
|
echo -n $(date "+%A, %e %B, %k:%M:%S")
|
2015-08-26 00:56:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
getVolume() {
|
2015-08-26 12:55:03 +02:00
|
|
|
echo -n "$(amixer get Master | cut -d$'\n' -f 5 | cut -d ' ' -f 8) $(amixer get Master | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p' | uniq)%%"
|
2015-08-26 00:56:33 +02:00
|
|
|
}
|
|
|
|
|
2015-08-26 12:42:05 +02:00
|
|
|
getMPD(){
|
|
|
|
echo -n "♫ "
|
|
|
|
if [ "$(mpc | wc -l)" -gt 1 ]; then
|
2015-08-27 15:01:41 +02:00
|
|
|
echo -n "$(mpc | cut -d$'\n' -f1) ♫ $(mpc | cut -d$'\n' -f2)"
|
2015-08-26 12:42:05 +02:00
|
|
|
fi
|
2015-08-26 00:56:33 +02:00
|
|
|
}
|
|
|
|
|
2015-08-26 12:42:05 +02:00
|
|
|
getNET(){
|
|
|
|
echo -n "$(curl -s http://canihazip.com/s)"
|
2015-08-26 00:56:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
buildBar () {
|
|
|
|
while true
|
|
|
|
do
|
2015-08-26 12:42:05 +02:00
|
|
|
echo "$(getVolume) $(getMPD) %{c}$(buildClock)%{r}$(getNET)"
|
2015-08-27 15:01:41 +02:00
|
|
|
sleep 0.5
|
2015-08-26 00:56:33 +02:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
buildBar | lemonbar -p -g "1872x20+24+8" -B "#181b20" -F "#9b9081" -f -gohu-gohufont-medium-r-normal--14-100-100-100-c-80-iso10646-1
|
2015-08-26 12:42:05 +02:00
|
|
|
|