OsdBar, LemonBoy Bar

January 19, 2014

As you read, maybe, in my other post, I try to have alternative's to conky. Having a one-liner adds great value to your desktop feel, appeal, and expressiveness, but can also unfortunately tend to be distracting. Nonetheless, I am back to having a conky like information bar on my desktop. I found LemonBoy's Bar recently. You can pipe your conky through it similar to dzen, or pipe a different script through it.

Installing it is quite simple, git clone it, make, sudo make install. You can find more details on the github page.

At first, I just wrote a simple conky to pipe through. Worked great. But figured I also have a script piping information through osd_cat. I could probably do some quick edits, a rename, and pipe that through bar, having yet anohter solution to conky. So that is what I did. And from the rubble came osdbar

#! /bin/bash

temp() {
    tempstat=$(cat /sys/class/thermal/thermal_zone0/temp | awk '{print $1/1000}')
    echo "$tempstat"
cpu() {
    cpustat=$(top -bn 2 -d 0.01 | grep '^%Cpu' | tail -n 1 | awk '{print $2+$4+$6}')
    echo "$cpustat"
mem() {
    memstat=$(free -m | grep buffers/cache | sed -e 's/[buffers/cache -+ :]//g' | sed 's/.\{4\}$//')
    echo "$memstat"
clock() {
    clockstat=$(date | sed -e 's/EST 2014//g')
    echo "$clockstat"
batt() {
    battstat=$(cat /sys/class/power_supply/BAT0/capacity)
    echo "$battstat"
mail() {
    echo "$mailstat"
music() {
    echo "$musicstat"
vol() {
    volstat=$(amixer get Master | tail -1 | sed 's/.*\[\([0-9]*%\)\].*/\1/')
    echo "$volstat"


while true; do
    echo  "     \f5m$(mail)  b$(batt)  r$(mem)  c$(cpu)  t$(temp)  v$(vol) \c\f9$(clock) \r\f9$(music)     "
    sleep 10s;

And in your .xinitrc

/path/to/script | bar -p &