dotfiles/lemonbar.sh

26 lines
602 B
Bash
Raw Normal View History

2015-08-26 00:56:33 +02:00
buildClock() {
2015-08-26 02:19:47 +02:00
echo -n $(date "+%A, %e %B, %k:%M:%S")
2015-08-26 00:56:33 +02:00
}
getVolume() {
echo -n "|Vol| $(amixer get Master | sed -n 's/^.*\[\([0-9]\+\)%.*$/\1/p' | uniq)%%"
}
getRAM(){
echo -n "free -m | awk 'NR == 2 {gsub(/%/,''); print }'"
}
getCPU(){
echo -n "grep 'cpu ' /proc/stat | awk '{usage=(+)*100/(++)} END {print usage}'"
}
buildBar () {
while true
do
echo "$(getVolume)%{c}$(buildClock)%{r}|IP| $(curl -s http://canihazip.com/s)"
sleep 1
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