You are not logged in.

#1 2009-11-19 07:25:22

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

[SOLVED] dwm + dzen2 + conky-cli misconfigured

I have been trying to pipe conky status to dzen2 and it is doing my head in.

My .xinitrc

#!/bin/sh
#
# ~/.xinitrc

setxkbmap -option terminate:ctrl_alt_bksp &
eval `cat ~/.fehbg` &
numlockx &
xscreensaver -no-splash &

# Dzen & conky
conky | dzen2 -fg '#dcdcdc' -bg '#3f3f3f' -ta r -fn '-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*' &

# Start dwm
exec ck-launch-session ~/Scripts/dwm-start

.conkyrc

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}^fg(#999999)BAT^fg()${battery_percent}%${else}AC${endif} * CPU ${cpu cpu1}%  RAM ${memperc}% * / ${fs_used_perc /}%  /home ${fs_used_perc /home}% * PKG ${execpi 900 ~/Scripts/pacman-up.pl} * ${if_existing /proc/net/route ra0}Down ${downspeedf ra0}K/s Up ${upspeedf ra0}K/s ${else} ${if_existing /proc/net/route eth0} Down ${downspeedf ra0}K/s Up ${upspeedf ra0}K/s${endif} ${endif}* ${time %I:%M%P}

Start dwm script

conky | while read line; do
    xsetroot -name "$line"; 
    done | while true; do 
dwm > /dev/null;  done;

Could anyone point me at what I am doing wrong? I have tried following examples in the forums, including this one and this one -- but I either end up with dwm 5.7.2 in the corner, or conky prints out the ^fg etc...

Any help would be appreciated at this point...

Last edited by jasonwryan (2009-11-20 06:11:51)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#2 2009-11-19 07:43:47

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

Hrmm well for starters you're executing conky twice...once in ~/.xinitrc and again in your startdwm script.  The former should work, but the latter is what's piping those ^fg tags into the dwm statusbar. I think all you want in your startdwm is:

while true; do 
dwm > /dev/null;  done;

thayer williams ~ cinderwick.ca

Offline

#3 2009-11-19 07:54:08

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

Thanks for the pointer Thayer - I had been trying various combinations (blindly groping in hope is the technical term).

I've made the change you suggested, but alas, am back at 'dwm-5.7.2' being the only thing printed out...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2009-11-19 08:07:01

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

It looks like you've got two endifs at the end of your .conkyrc file, when you only need one (unless I've misread it).
Not connected to your problem, but you're displaying ra0 up and down in the eth0 clause of the same if statement. I'm guessing, copy&paste error? wink


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#5 2009-11-19 08:16:25

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

Thanks Skanky - well spotted (haven't had it plugged into a cable, so that is one glitch I won't be dealing with down the track)...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2009-11-19 09:33:07

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

One other point, do you have a \ at the end of the first TEXT line in conkyrc? You need to escape the newline.

Do you get correct output to stdout if you just run conky in a terminal? If not, the problem is in the conkyrc. If you do, the error lies elsewhere.

When I first got conky up and running, I couldn't get it working with dzen2 and swictched to conky-cli which did work. However, I see from the man page that conky should work now. I don't use it any more, so can't compare with my set-up.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#7 2009-11-19 16:32:11

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

Thanks for the suggestions Skanky. The broken line in conky was a copy/paste error into the browser - it is a single line conky (I've edited the OP to reflect that).

I think it is a problem with the way conky-cli and dzen work together. If I run:

echo "testing" | dzen2 -fg '#dcdcdc' -bg '#3f3f3f' -ta r -fn '-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*' -p

it prints as expected.

Similarly, if I comment the conky | dzen2 line in .xinintrc and just run conky-cli from the start script it works...

Trying to get then to work together, however, is another matter.

/edit

Some progress: it seems that it is being drawn - if I Mod-Shift-q the dwm status bar briefly disappears and I can see conky momentarily. I tried starting conky | dzen2 after dwm but that didn't work.

I have also added some options, which seem to have helped, my .xinintrc entry now looks like:

conky | dzen2 -x '500' -e '' -fg '#dcdcdc' -bg '#3f3f3f' -ta r -fn '-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*' -p &

Last edited by jasonwryan (2009-11-19 16:57:13)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2009-11-19 21:34:30

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

I almost have it working: it flickers briefly as dwm loads, and then the default status bar (with dwm-5.7.2) overwrites it. Similarly, reloading dwm (Mod-Shift-q) reveals it momentarily. Anyone have any idea how to get it to sit above the dwm bar (short of hacking a space for it)?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2009-11-19 22:04:58

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

Just remembered that dwm is not like the others (haven't used it myself, yet).

See http://bbs.archlinux.org/viewtopic.php? … 92#p394692 and the rest of that thread.

You could just pipe the conky stuff to dwm and display it in its status bar, though you may lose some formatting. Otherwise, a search may bring up another solution - but this thread was the second Google hit for dwm & dzen. wink


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#10 2009-11-19 22:23:26

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

Thanks for hanging in there Skanky. I tried the suggestion in the post, but it still flickers momentarily (tantalizingly, even) and then is gone...

I don't want to go down the route of hacking dwm.c - I believe it is possible to get it working without altering the source (but I might be wrong about that).

I was previously piping it directly into dwm's bar -- and that works fine. However, the allure of formatting that text became a temptation that is now approaching an obsession...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#11 2009-11-19 22:38:35

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

I know what you mean, I spent ages building a dzen2 bar for xmonad, using conky & scripts. However, I've gone a bit more minimalist now. I reckon you'll have to do a fair bit of. The dwm mailing list will have an archive somewhere.

That suggestion there may have been misremembered so it may be worth hunting for the original email on the list.

Good luck though. Let us know if you find anything as I'm thinking of adding dwm as my "other" wm (everybody gotta have two).


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#12 2009-11-20 03:31:04

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

Hi Skanky. Yes, I have been trawling through the suckless archives but, like the posts on the forums here, most refer to older versions of dwm where the only option is making changes to dwm.c

I had hoped that, given the number of posts on the subject -particularly on the Dzen & Xmobar Hacking thread- that newer versions of dwm would accomodate this behaviour.

I'll keep looking and tinkering and post if I crack it. Thanks for the suggestions, they have been appreciated.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#13 2009-11-20 06:11:16

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

Cracked it! Not the most elegant solution, but it works:

Changed .xinitrc to paint dzen well after the dwm status bar is set...

# 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

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#14 2009-11-20 07:42:50

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

Nice one.

I did wonder, late last night, if some sort of solution could be built round the "send dzen SIGHUP1" (from the other thread). If not using conky but a status script, it could have been incorporated into that, to send the SIGHUP1 every time it updated the bar. I dunno if conky could be configured to do that. Not sure it'd be any more elegant than your solution though.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#15 2009-11-20 08:35:00

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

With my (limited) ability, elegance comes a long way after practicality... smile

/edit

...and the finished product:

4121324068_6ec29262d7_m.jpg

Last edited by jasonwryan (2009-11-21 03:14:52)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#16 2009-12-15 10:42:06

riivo
Member
Registered: 2008-08-25
Posts: 112

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

This solution has a downside of not being flexible. The position where dwm can write the window title ends and where dzen starts is firmly fixed. Not too bad in your case, I believe, but if you use fancybar patch and the amount if information piped through dzen changes a lot, it gets ugly. Hopefully, some day dwm bar will be able to parse icons like dzen.

By the way, you could write just

sh .fehbg &

instead of

eval `cat ~/.fehbg` &

Offline

#17 2009-12-15 17:44:10

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] dwm + dzen2 + conky-cli misconfigured

Yes, it is ugly in that respect...

Thanks for the tip about setting the bg.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB