dotfiles/lemonbar.sh
2015-08-27 19:12:34 +00:00

34 lines
739 B
Bash
Executable File

buildClock() {
echo -n $(date "+%A, %e %B, %k:%M:%S")
}
getVolume() {
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)%%"
}
getMPD(){
echo -n "♫ "
if [ "$(mpc | wc -l)" -gt 1 ]; then
echo -n "$(mpc | cut -d$'\n' -f1)$(mpc | cut -d$'\n' -f2)"
fi
}
getNET(){
echo -n "$(curl -s http://canihazip.com/s)"
}
getDISK(){
echo -n "$(du -hs ~ | cut -d$'\t' -f1)"
}
buildBar () {
while true
do
echo "$(getVolume) $(getMPD) %{c}$(buildClock)%{r}$(getDISK) | $(getNET)"
sleep 0.5
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