Bar / Conky Configs. - Desktop Customization & Workflow

Users browsing this thread: 6 Guest(s)
jmbi
Long time nixers
Bar* is a lightweight bar program, it is easily configurable with conky. I use it in all of my desktop setups, and it works great!

Here is my current Bar* setup (it is usually at a width of 1600 pixels, but I resized it for demonstration purposes, I have a bit of an OCD problem...):
[Image: jjFQv.png]

Now, to run this I just add this to my .xinitrc:
Code:
conky | bar -p &

As you can see, the bar is just a place where conky can output information. Also, if you look on the left side of the bar, you can see a simple little rss output, look in the config below to see how that works.

Here is my .conkyrc:
Code:
background no
out_to_console yes
out_to_x no
update_interval 1.0
total_run_times 0
use_spacer none

TEXT
\f3${mem} \f4of\f3 ${memmax} \c\f7${time %H:%M:%S}\r \f5UnixHub: \f4${rss http://forums.unixhub.net/syndication.php 1 item_titles 1}

Here is my config.h config for the bar itself:
Code:
/* The height of the bar (in pixels) */
#define BAR_HEIGHT  18
/* Choose between an underline or an overline */
#define BAR_UNDERLINE 1
/* The thickness of the underline (in pixels). Set to 0 to disable. */
#define BAR_UNDERLINE_HEIGHT 1
/* Whether to put the bar at the screen bottom or not */
#define BAR_BOTTOM 1
/* The fonts used for the bar, comma separated. Only the first 2 will be used. */
#define BAR_FONT       "-*-terminus-medium-r-normal-*-12-*-*-*-c-*-*-1","fixed"
/* Color palette */
#define COLOR0    0x292929
#define COLOR1  0xBADA55
#define COLOR2    0x101010
#define COLOR3    0xcc6666
#define COLOR4    0xFB7D24
#define COLOR5    0xb3930f
#define COLOR6    0x286f8a
#define COLOR7    0x746d76
#define COLOR8    0x42ab9e
#define COLOR9    0xc0c0c0

Those colors are my .Xdefaults colors.

Now, you've seen my configuration, show me yours!

*When I say Bar in this thread, I am referring to the LemonBoy / Bar that you can find here: [the github.](https://github.com/LemonBoy/bar)
meh
yrmt
Grey Hair Nixers
Nice and clean bar.
Jayro
Long time nixers
Nice! I might have to give this a try!
DotDev
Long time nixers
Here is My Bar, Hope you enjoy

[Image: L7pczzz.png]

*Still Perfecting my bar, will add icons when I get the chance.
zygotb
Long time nixers
Right on guys, this is exactly the kind of stuff that we need more of. Thanks for sharing.

I don't use conky, and my dwm bar is nothing special. Sorry for not sharing.
funriz
Members
bar with some powerlineporn:

[Image: qNqbLGy.png]

or link:

http://i.imgur.com/qNqbLGy.png
lidstah
Members
Well, it's not really a bar nor real conkyporn, but if people here use wmii, notion and even stumpwm modeline, you'll notice that you can't really use conky as is with their statusbar system.

For example, you can use conky cli output in wmii's bar, but only if you run conky with the -i flag (conky -i 1 for example), which kind of disable CPU and network statistics (else, wmii will hang on start, for example. Notion will just display nothing iirc, and stump will scream some lispy insults in your face).

So I ended up using a simple solution: piping conky output in a textfile, then echoing this text file in wmii's/notion/stump statusbar/modeline:

Code:
#!/bin/bash

conky -c yourconkyconffile | while read -r; do echo $REPLY > /mnt/ramdisk/conkytext; done &

while conky is running, it reads its standard output, then echoes it in a file. Simple, and, for example, in wmii's config, just echo -n $(cat /mnt/ramdisk/conkytext) as your status line feed. And, yay, working cpu and network statistics in your statusbar. It also works in tmux statusbar! :)

I use a little ramdisk for this, as I'm not really fond of waking up my harddisks every second just to write some small textfile. Also, SSDs might not like this kind of constant overwriting of a file

Hoping it'll be usefull to some people here, just wanted to share this little tip.
earsplit
Members
I also pipe Conky into BAR, using some scripts to change icons based on levels.

https://github.com/windelicato/dotfiles/...spwm/panel

panel is started with
Code:
panel &
alt + tab brings up the launcher menu with
Code:
launcher launcher_apps

[Image: 5lYBm]
»» windelicato.com ««
berk
Long time nixers
[Image: xYA]
cyberpunkz
Members
Here is my Conky + Bar in MCWM the bottom bar is xmobar with a tiny script to show xmms2 current , weather and simple freebsd uptime.
More screenshots on my Deviantart @http://ipodpunker.deviantart.com/
[Image: mcwm___bar__based_on_xcb____xmobar_on_fr...763wp3.png]
venam
Administrators
(12-02-2014, 03:03 AM)cyberpunkz Wrote: Here is my Conky + Bar in MCWM the bottom bar is xmobar with a tiny script to show xmms2 current , weather and simple freebsd uptime.
More screenshots on my Deviantart @http://ipodpunker.deviantart.com/
[Image: mcwm___bar__based_on_xcb____xmobar_on_fr...763wp3.png]

This truly kicks ass! I love it. Very original.
cyberpunkz
Members
thanks , I put quite some time into it lulz.. i wish i can add workspace tags like u see on other tiling manager. MCWM is not tiling which is what i like about it.. but u still have 10 workspaces. be nice if i can use bar to have tabs for mcwm.. its no big deal as i have to remember everything i have for each workspace lulz.

be cool like take bspwm "workspace tags" and have it for mcwm :P

Cheers
yrmt
Grey Hair Nixers
You should look into 2bwm, you can have workspace tags with it.
cyberpunkz
Members
i have look into 2bwm its just the border is different from mcwm and i wish to just have the mcwm back .


and thanks for letting me know, yBeastie. if you got some time to help me out with the workspace tagging or some examples , so i can just see and do my own thing.


thanks for letting me know :)

2bwm is cool by the way. I think its u that fork mcwm , if im not mistaken.


i'm using the mcwm-beast source which i think its by u with the patches .

Cheers!
cyberpunkz
Members
Hey heres a 2bwm screenshot with pcmanfm, conky | bar , xmobar.

[Image: 2bwm_lilac_theme_by_ipodpunker-d766v7v.png]
cyberpunkz
Members
Here is 2 screenshots of 2bwm with conky pipe to bar, pcmanfm and tmux + weechat :)

Screenshot 1
[Image: 2bwm_blown_theme___clean_by_ipodpunker-d768ada.png]
Screenshot 2
[Image: 2bwm_brown_theme_weechat_pcmanfm_tmux_ba...768avj.png]
Theme + .Xdefault & bar is all using Terminus font.
yrmt
Grey Hair Nixers
Nice! Try to use the same font in your terminal and on your gtk theme and your top bar.
cyberpunkz
Members
it is the same font to be honest, but i took your advice, and re-sized the font.

This is what i came up with, not sure if you consider this a "improvement". I think it looks better. :)

[Image: 2bwm_terminus_font_by_ipodpunker-d7698ms.png]
BSD (OS X & FreeBSD)
UNIX & VMS/VAX emulation simh: Ultrix 4.3BSD, WISC UNIX, OpenVMS 7.3, and
SunOS Solaris.
PekWM :: BMPanel2
yrmt
Grey Hair Nixers
Yes! this is good.
rudylorren
Long time nixers
(19-01-2014, 06:03 AM)funriz Wrote: bar with some powerlineporn:

[Image: qNqbLGy.png]

or link:

http://i.imgur.com/qNqbLGy.png

Can you post configs? :)
Nothin left to do but smile, smile, smile (~);}
funriz
Members
kirby
Long time nixers
I'm using bar for the first time and although I have it looking nice (though not finished, still need the desktops), I've clearly done something wrong. Every time it updates, it just creates a new instance on top of the old one, and this quickly fills up the resource limit on X (I didn't even know X had a resource limit). My script for the bar is here. What do I do to fix this issue?
dcli
Long time nixers
Updates how, kirby? Like every time the clock changes?
kirby
Long time nixers
Every second, it's a loop with 'sleep 1' at the end. You can see how this would really quickly fill up the limit.
pvtmert
Members
kirby, pipe bar after 'done' also you can use while sleep 1; do
something something
echo something | tr -d \\n #trim newline for actually viewing output
done | bar -p #something else

this is my current bar script:
Code:
#!/bin/bash

SLP=1
BG=\#de002b36
FG=\#de839496
PX=1
FT="-*-terminus-medium-r-normal-*-12-*"

{ #looknfeel
    OPACITY=85
    BACKGROUND=232c31
    FOREGROUND=c5c8c6
    COLOR0=2d3c46
    COLOR1=ac4142
    COLOR2=90a959
    COLOR3=de935f
    COLOR4=6a9fb5
    COLOR5=aa759f
    COLOR6=75b5aa
    COLOR7=6c7a80
    COLOR8=425059
    COLOR9=cc6666
}


makecolor()
{
    echo $(printf "#%x%s" $((OPACITY*255/100)) "$1")
}

{ #GLOB VARS
    USER=$(whoami)
    GRP=$(id -g)
    HOST=$(hostname)
    DOMAIN=$(domainname)
    BATF="/sys/class/power_supply/BAT1/capacity"
    LDAVGF="/proc/loadavg"
    # static colors:
    USRC=\#ff000000
    DATEC=$(makecolor $COLOR3)
    test $GRP -eq 0 && USRC=darkred
    test $GRP -eq 2 && USRC=yellow
    test $GRP -eq 4 && USRC=maroon
    test $GRP -eq 3 && USRC=gray
    test $GRP -eq 5 && USRC=black
    test $GRP -eq 29 && USRC=green
    LDAVGC=$(makecolor $COLOR6)
    DESKCL=$(makecolor $COLOR1)
    FG=$(makecolor $FOREGROUND)
    BG=$(makecolor $BACKGROUND)
}

NAT=`hostname`
while sleep $SLP; do
    test $(($(date +%s)%20)) -eq 0 && NAT=$(curl --connect-timeout $((SLP*2)) -s icanhazip.com || echo "(no-*net)")
    echo
    {
        INET=$(ifconfig | grep inet | grep -v inet6 | grep -v 127.0.0.1 | cut -d\  -f10 | tr \\n '|')
        BATS=$(cat $BATF)
        BATC=gray
        test $BATS -gt 80 && BATC=green
        test $BATS -lt 40 && BATC=yellow
        test $BATS -lt 20 && BATC=red
        BAT=$(printf "%3d" $BATS)
        LOADAVG=$(cat $LDAVGF | cut -d\  -f1-3)
        DESKC=$(xprop -root _NET_CURRENT_DESKTOP | sed -e 's/_NET_CURRENT_DESKTOP(CARDINAL) = //')
        test $DESKC -eq 0 && DESKB=9 || DESKB=$((DESKC-1))
        test $DESKC -eq 9 && DESKA=0 || DESKA=$((DESKC+1))
        # sep
        echo "%{c}%{+o}%{U-}"
        echo " < %{U$LDAVGC}%{A:xterm -e htop &:}$LOADAVG%{A}%{U-} > "
        echo " < %{U$BATC}%{A:xterm -e powertop &:}BAT: $BAT%%%{A}%{U-} >"
        echo " < %{U$DATEC}%{A:xclock &:}$(date +'%A, %Y-%m-%d | %H:%M:%S')%{A}%{U-} > "
        echo " < $DESKB |%{U$DESKCL} $DESKC %{U-}| $DESKA > "
        echo " < %{U$USRC}%{A:systemsettings &:}$USER@$INET$NAT%{A}%{U-} > "
    } | tr -d \\n | tr -s \
done | bar -u$PX -F$FG -B$BG -f$FT -d

exit 0

and this is prev. one

Code:
#!/bin/bash

WIDTH=170
WIDTH=$((170-15))
SW=31
SLP=1.5
SEP=" | "

for i in 0 1 2 3; do sleep $SLP; done
{ #glob vars
    batd=/sys/class/power_supply/BAT1/
    min=$((0))
    if [ "$WM" == "twm" ]; then
        min=$((1))
        desk=($(printf "9\n"; vdesk))
        max=$((${desk[0]}))
    else
        min=$((0))
        #desk=$(xprop  -root  _NET_CURRENT_DESKTOP|  sed  -e 's/_NET_CURRENT_DESKTOP(CARDINAL) = //')
        desk=($(xprop -root | grep -i cardinal | grep -i desktop | grep -iv "xprop\|grep\|cut" | cut -d\= -f2 | cut -b 2-))
        max=$((${desk[0]} - 1))
    fi
    i=0
    who=`whoami`
    host=`hostname`
    dom=`domainname | sed 's/\./[dot]/g'`
    user="mert"
    text=("`swapon -s | tail -n1 | tr -s ' ' | sed 's/\t/ /g' | cut -d\  -f1,2,3,4 | cut -b -$((SW-3))`"
          "\f6`uname -mroi | tr -s ' ' | cut -b -$SW`\fr"
          "`date | cut -b -$SW`"
          "`uptime | cut -b -$SW`"
          "`echo \"$user: $who[at]$dom\" | cut -b -$SW`" )
    #`printf "$user: $who[at]$dom" | cut -b -$SW`
}

while true; do
{
    text[2]="\\u3`date +\"%A, %Y-%m-%d ¦ %H:%M:%S\" | cut -b -$SW`\\ur"
    text[3]="\\u4`uptime | cut -d, -f1,2,3 | sed 's/\t/ /g' | tr -s ' ' | sed 's/load average:/load:/g' | cut -d\  -f3,4,5,6,7,8,9 | rev | cut -b 1- | rev | cut -b -$SW`\\ur"

    #batf=$(cat $batd/energy_full)
    #batn=$(cat $batd/energy_now)
    #bats=$(( 100 * batn / batf ))
    bats=$(cat $batd/capacity)

    ups=$(cat /proc/uptime | cut -d\  -f1 | cut -d. -f1)
        days=$((ups/(60*60*24)))
            ups=$((ups-days*60*60*24))
        hrs=$((ups/3600))
            ups=$((ups-hrs*3600))
        mins=$((ups/60))
            ups=$((ups-mins*60))
        text[0]=$(printf "\\\u6 Bat: % 3d%% \\\ur ¦ Up: %02dd %02dh %02dm %02ds" ${bats} ${days} ${hrs} ${mins} ${ups} )
        text[0]=$(printf "%*s" $SW "${text[0]}")
        text[3]="\\u4 load avg: `cat /proc/loadavg | cut -d\  -f1,2,3` \\ur"

    if [ "$WM" == "twm" ]; then
        desk=($(printf "9\n"; vdesk))
    else
        desk=($(xprop -root | grep -i cardinal | grep -i desktop | grep -iv "xprop\|grep\|cut" | cut -d\= -f2 | cut -b 2-))
    fi

    printf "\n\l ! \c"
    for i in {0..3}; do
    { #Sections
        printf "%-*s" $SW "${text[$i]}"
    }; printf "$SEP"; done
    #i=$((i+1)); printf "%-*s\\\r ! " $((SW-3)) "${text[$i]}"
    for ((i=${desk[1]}-3;i<${desk[1]}+4;i++)); do
        if [ "$i" == "${desk[1]}" ]; then
            printf '\\\\\\u1 %d \\\\\\ur' $i
        elif [ $i -lt $min ]; then
            printf " $((i+${desk[0]})) "
        elif [ $i -gt $max ]; then
            printf " $((i-${desk[0]})) "
        else
            printf " $i "
        fi
    done | { read x; printf "%*s  ¦ %*s" $((SW-${#who}-1)) "$x" $((SW-${#x})) "$who" ; }
    printf "\\\r ! "
}; sleep $SLP; done | /usr/bin/bar -pfl

exit 0

Code:
Slax 7.0.8 (32-bits + PAE)
----- BEGIN GEEK CODE BLOCK-----
Version: 3.1
GE/CS/CM/S d+@ s-:- a--- C++++(++) UL+++ P+ L+++ E?() W+++(++) N? o? K- w+
O M-- V- PS+ PE Y? PGP- t+ 5? X++++(+++) R- !tv b+ DI? D- G e- h+ r-- z--
------END GEEK CODE BLOCK------
kirby
Long time nixers
(15-07-2014, 05:12 PM)pvtmert Wrote: kirby, pipe bar after 'done' also you can use while sleep 1; do
something something
echo something | tr -d \\n #trim newline for actually viewing output
done | bar -p #something else

I'm not entirely sure I understand what's going on here, and can't get it to work myself. How do you get the bar to see what's being echo'd? If I end in

Code:
tr -s /
done | bar

I get 'Unexpected end of file'. You know you can use 'echo -n' to get rid of the newline right?
pvtmert
Members
backslash is important, i used to squeeze spaces into one...
you got it about echo -n

you have to pipe to bar 'after' all output. you can think as while never prints eof so bar will stay open and being refreshed.

all you have to do is
while sleep $((SLEEP));
do
echo -n "hello world"
done | bar #args
neeasade
Grey Hair Nixers
Here is my bar configuration:

[Image: xrnris.png]

The smaller squares are workspaces, and the larger on on the end is a tiling/monocle mode indicator. If in monocle mode, the bar turns into clickable title text for windows in the workspace:

[Image: ymlffx.png]

and a link to it's configuration!: link
seninha
Long time nixers
What is the difference between lemonbar and dzen2? What can I do with dzen2 that I cannot do with lemonbar (and vice-versa)?
neeasade
Grey Hair Nixers
> What can I do with dzen2 that I cannot do with lemonbar

dropdowns/the notion of a 'heading' on dropdowns. personally I think the lemonbar experience is "cleaner" wrt constructing sections with settings (I made a small helper for it).


Speaking of necrobumps, I recently updated my own panel configuration -- I now use i3blocks to drive lemonbar, through jq. See the madness here. i3blocks generates _a lot_ of output, so I debounce it. I still use a theming system to generate my i3blocks config -- here's an example of what an i3blocks config might look like: https://0x0.st/i262.txt . The 'season' script is responsible for theme ideas around panel sections.