jasonwryan.com

Miscellaneous ephemera…

dzen2 and conky-cli in dwm

I struggled over the last couple of days to pipe conky into a Dzen2 status bar alongside the default dwm bar.

Here is how I sorted it.

First, I installed conky-cli and dzen2. Conky-cli is in AUR, and dzen2 is in Community:

1
pacman -S dzen2 && yaourt conky-cli

Then it was a matter of setting up the relevant files.

.xinitrc.sh
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh
# ~/.xinitrc
setxkbmap -option terminate:ctrl_alt_bksp &
eval `cat ~/.fehbg` &
numlockx &
xscreensaver -no-splash &
# Dzen & conky
(sleep 15s && conky | dzen2 -x '500' -e '' -fg '#dcdcdc' -bg '#3f3f3f' \
-w '650' -ta r -fn '-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*' -p ) &
# Start dwm
exec ck-launch-session ~/Scripts/dwm-start
.conkyrc .sh
1
2
3
4
5
6
7
8
background no
out_to_console yes
update_interval 2
total_run_times 0
use_spacer none
double_buffer yes
TEXT
${if_existing /sys/class/power_supply/BAT0/present}^i(/home/jason/Build/dwm/dzen/bat.xbm)…
dwm-start .sh
1
2
3
while true; do 
    dwm >/dev/null
done

The key is —and it took me a while to work it out— to delay the loading of conky until after dwm has painted it’s status bar; otherwise conky | dzen2 is obscured.

Now, the “before” shot:

…and the finished product:

Conky-cli to dzen2 in dwm on Arch

Comments