SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2009-03-07 18:56:07

mcarni
#! CrunchBanger
Registered: 2009-02-10
Posts: 132

[SOLVED] Restarting multiple conky instances [WAS: menu.xml help]

i was playing with my conky, when i decided that the best solution would be to have 4 different conky instances, 1 on the top left, 1 on the bottom left bottom right and top right side of my desktop.

it all seems fine, i can launch 4 instances in my terminal with:

conky -q -c /home/koalinki/.Conky_files/conky_TL & conky -q -c /home/koalinki/.Conky_files/conky_BL & conky -q -c /home/koalinki/.Conky_files/conky_BR & conky -q -c /home/koalinki/.Conky_files/conky_TR

i updated autostart.sh accrodingly, but now i need to tweak the actual 4 conky files so to get everything right and i need to get conky restart to work in my menu.xml.
I would like to have restart conky on my menu.xl setup so that it kills all conky instances and relaunches all four of them.
I tried to edit the menu.xml several times, but i seem to get always something wrong, I guess the problem is with "&"
i checked on the openbox site but i didn't find anything helpful, apart form a note saying that I should use "&amp" instead of "&"

is there anyone that could help me with this?

thanks in advance

M

Last edited by mcarni (2009-03-07 20:18:55)

Offline

Be excellent to each other!

#2 2009-03-07 18:59:05

Mehall
#! Die Hard
From: Scotland, Cold
Registered: 2009-01-17
Posts: 850
Website

Re: [SOLVED] Restarting multiple conky instances [WAS: menu.xml help]

mcarni wrote:

i was playing with my conky, when i decided that the best solution would be to have 4 different conky instances, 1 on the top left, 1 on the bottom left bottom right and top right side of my desktop.

it all seems fine, i can launch 4 instances in my terminal with:

conky -q -c /home/koalinki/.Conky_files/conky_TL & conky -q -c /home/koalinki/.Conky_files/conky_BL & conky -q -c /home/koalinki/.Conky_files/conky_BR & conky -q -c /home/koalinki/.Conky_files/conky_TR

i updated autostart.sh accrodingly, but now i need to tweak the actual 4 conky files so to get everything right and i need to get conky restart to work in my menu.xml.
I would like to have restart conky on my menu.xl setup so that it kills all conky instances and relaunches all four of them.
I tried to edit the menu.xml several times, but i seem to get always something wrong, I guess the problem is with "&"
i checked on the openbox site but i didn't find anything helpful, apart form a note saying that I should use "&amp" instead of "&"

is there anyone that could help me with this?

thanks in advance

M


Best idea is to edit conkywonky, which is what is called when you click "restart conky" in the menu.

You'll need sudo rights, and it's held in /usr/bin/crunchbang/

File name conkywonky (so "sudo nano /usr/bin/crunchbang/conkywonky")


Ex-KDE user.
Collects old PC's (Coz he can't afford new ones =P)
Crunchbang @ Distrowatch
My Blog (updated infrequently, and on the #! Planet too.)

Offline

#3 2009-03-07 19:36:08

corenominal
WRONG
From: Lincoln, UK
Registered: 2008-11-20
Posts: 5,131
Website

Re: [SOLVED] Restarting multiple conky instances [WAS: menu.xml help]

mcarni wrote:

I would like to have restart conky on my menu.xl setup so that it kills all conky instances and relaunches all four of them.
I tried to edit the menu.xml several times, but i seem to get always something wrong, I guess the problem is with "&"
i checked on the openbox site but i didn't find anything helpful, apart form a note saying that I should use "&amp" instead of "&"

is there anyone that could help me with this?

thanks in advance

M

Hello M smile

I have been playing around with something similar, I edited my conkywonky, as stated by Mehall, to the following:

#!/bin/sh
if [ "$(pidof conky)" ]; then
    killall conky
    egrep '^(conky|\(sleep [0-9]s & conky)' ~/.config/openbox/autostart.sh | grep ' &$' > ~/.conkywonky
    . ~/.conkywonky
    rm -f ~/.conkywonky
    exit 0
else
    egrep '^(conky|\(sleep [0-9]s & conky)' ~/.config/openbox/autostart.sh | grep ' &$' > ~/.conkywonky
    . ~/.conkywonky
    rm -f ~/.conkywonky
    exit 0
fi

The script works by parsing my autostart.sh file for conky instances, before storing the results in a temporary file and then using the file to restart them. I have only done limited testing on it, but the script is quite simple and so it should work for you. Hope it helps smile


Ex-developer of #! CrunchBang. Follow me on Twitter smile

Offline

#4 2009-03-07 20:21:58

mcarni
#! CrunchBanger
Registered: 2009-02-10
Posts: 132

Re: [SOLVED] Restarting multiple conky instances [WAS: menu.xml help]

Guys you are simply fantastic...


thanks a lot, i can now play with my conky files...
i will make sure i will post them on our forum...

thanks again...


PS I followed Mehall advise and this is what I have on my conwywonky, it seems to work ok....
@ Corenominal I will try also your modification. THANKS to both of you

#!/bin/sh
if [ "$(pidof conky)" ]; then
    killall conky
    conky -q -c /home/koalinki/.Conky_files/conky_TL &
    conky -q -c /home/koalinki/.Conky_files/conky_BL &
    conky -q -c /home/koalinki/.Conky_files/conky_BR &
    conky -q -c /home/koalinki/.Conky_files/conky_TR &
    exit
else
    conky -q -c /home/koalinki/.Conky_files/conky_TL &
    conky -q -c /home/koalinki/.Conky_files/conky_BL &
    conky -q -c /home/koalinki/.Conky_files/conky_BR &
    conky -q -c /home/koalinki/.Conky_files/conky_TR &
    exit
fi

Offline

#5 2009-03-07 20:33:55

Mehall
#! Die Hard
From: Scotland, Cold
Registered: 2009-01-17
Posts: 850
Website

Re: [SOLVED] Restarting multiple conky instances [WAS: menu.xml help]

You're more than welcoem, i'm just glad you got it working they way you want.


Ex-KDE user.
Collects old PC's (Coz he can't afford new ones =P)
Crunchbang @ Distrowatch
My Blog (updated infrequently, and on the #! Planet too.)

Offline

#6 2009-07-26 08:44:05

tawan
#! Junkie
Registered: 2009-01-30
Posts: 385
Website

Re: [SOLVED] Restarting multiple conky instances [WAS: menu.xml help]

came across this on an altogether different search but to restart multiple conky's you just do

killall -SIGUSR1 conky

I blog too much....       geek stuff LinuxMintDebian | linux noob stuff LinuxMintNoob | spiritual stuff Daily Cup of Tao

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo