You are not logged in.
I'm pretty new to tiling wms but now that I've started I can't go back to KDE or even Openbox. I'm wondering what the best way for conky-cli to interact with awesome3 is. I've tried some of the stuff on the wicked page for custom widgets but that generates some kind of default/myconfig hybrid with awesome. I'll post details later but I'm at work and I thought I'd see what the smarter people have to say before I show my attempts in public.
Thanks in advance.
Offline
It's possible to pipe lua code to 'awesome-client', eg sometextbox.text = "whatever"'. I haven't tried using conky-cli with it, but I assume its possible to just format the TEXT section with the necessary lua.
Offline
I tried putting this in my conky config
TEXT
cpumon.text = '${freq_g}GHz ${cpu}%
with
conky | awesome-client
but nothing happens.
Echoing lua into awesome-client works fine
echo "cpumon.text = 'hello everyone'"| awesome-client
Offline
my original conky config had the second single quote and looked like this
TEXT
cpumon.text = '${freq_g}GHz ${cpu}%'
Offline
Hmm yes it appears I assumed wrong. I can't get it to work either.
Offline
From http://awesome.naquadah.org/wiki/index. … r_creation
Here is an example of putting /proc/loadavg to mytextbox:
mytextbox.text = " " .. execute_command("cat /proc/loadavg") .. " "
I though maybe this might work : mytextbox.text = " " .. execute_command("conky") .. " " ,but it's not. And their example is not working either.
I tried putting this in my conky config
TEXT cpumon.text = '${freq_g}GHz ${cpu}%
with
conky | awesome-client
but nothing happens.
Echoing lua into awesome-client works fine
This puts conky on the root window for me.
Last edited by ur25 (2008-10-13 19:10:21)
Offline
I don't use conky, but I was just playing with it a bit. And it seems that awesome-client won't do anything until conky stops. You can confirm this yourself by running "conky -i1 | awesome-client", which runs conky once and exits. That should update awesome. That said, I don't know what the best solution is. You probably need some way of outputting conky to a temp file and then having awesome read that file.
Offline
I've just configured widgets with the wicked library so I don't need conky anymore, but I would like to know the solution anyway.
Offline
This would be a solution:
function updateconkywidget()
conkywidget.text = io.popen('cat /tmp/conky_output'):lines(){0}
end
function runconky ()
os.execute('conky -i1 > /tmp/conky_output &')
end
conkywidget = widget({ type = 'textbox', name = 'conkywidget', align = 'right' })
awful.hooks.timer.register(5, updateconkywidget)
awful.hooks.timer.register(5, runconky)
This writes conky's output to a file every 5 seconds in the background. And then reads it into awesome every 5 seconds as well. Using this method, the conkyrc file for the example above would simply be:
TEXT
${freq_g}GHz ${cpu}%
Also a benefit to doing this is that you don't use wicked, which isn't as responsive as I'd like it to be.
Last edited by kett (2008-10-13 20:45:59)
Offline
I don't use conky, but I was just playing with it a bit. And it seems that awesome-client won't do anything until conky stops. You can confirm this yourself by running "conky -i1 | awesome-client", which runs conky once and exits. That should update awesome. That said, I don't know what the best solution is. You probably need some way of outputting conky to a temp file and then having awesome read that file.
Have you guys tried outputting empty line into awesome-client? awesome-client manpage:
When you pipe multiple lines into awesome-client, an empty line will flush already collected lines into awesome with an according immediate execution.
Maybe because conky runs "forever" piping into awesome-clinet, you won't get any action until conky stops or outputs empty line...
Offline
So what would be the best way to get conky to output an empty line? None of the conky variables appear to do that, nor does a newline character. Adding extra lines to the end of TEXT doesn't appear to do anything either.
Offline
There's a simple mod to the conky sourcecode to do just that, found here on the awesome wiki.
Offline
Awesome! (no pun intended) That patch did the trick. The source has changed slightly since the wiki entry. The change is still in conky.c but at
width_of_s = get_string_width(s);
if ((output_methods & TO_STDOUT) && draw_mode == FG) {
printf("%s\n\n", s);
fflush(stdout); /* output immediately, don't buffer */
}
which starts at what is currently line 6673. Thanks for everyone's help. Is this little patch worth another package in the aur or is it too specific. I'm really new to the Arch community and don't know how to contribute back in a meaningful way yet.
Last edited by nuclearsandwich (2008-10-13 23:19:40)
Offline
I wonder how often is the solution old simple... read the manual
Offline
Hi, I've followed the instructions and modified the conky.c file before compiling conky but it doesn't seem to be working.
Here is my .conkyrc
background no
no_buffers yes
out_to_console yes
update_interval 1
uppercase no
use_spacer none
total_run_times 0
TEXT
conky_textbox.text = 'test'
This does nothing :
$conky | awesome-client
^CConky: received SIGINT or SIGTERM to terminate. bye!
Here is what conky outputs :
$conky
conky_textbox.text = 'test'
conky_textbox.text = 'test'
conky_textbox.text = 'test'
conky_textbox.text = 'test'
conky_textbox.text = 'test'
conky_textbox.text = 'test'
conky_textbox.text = 'test'
conky_textbox.text = 'test'
conky_textbox.text = 'test'
conky_textbox.text = 'test'
conky_textbox.text = 'test'
conky_textbox.text = 'test'
^Cconky_textbox.text = 'test'
Conky: received SIGINT or SIGTERM to terminate. bye!
And this line IS working :
$echo "conky_textbox.text = 'test'" | awesome-client
I don't understand what the problem is, can somebody help me?
Thank you!
Last edited by ur25 (2008-10-19 14:46:18)
Offline
I used the conky-cli package from the AUR as a starting point, modified the source .tar and the md5sum in the PKGBUILD and then built the conky-cli-awesome package and installed it with pacman -U
This is my conky config
update_interval 2.0
TEXT
conkybar.text = 'Clock: ${freq_g}GHz CPU: ${cpu}% Processes/Running: ${processes}/${running_processes} Memory: ${memperc}% Battery: ${battery}'
When I login it I've configured it to run awesome.sh which starts some terminals and starts piping conky into awesome client with this line
conky | awesome-client &
Offline
Hi,
I think the modification I do in the src/conky.c are not taken into consideration because when I enter this in the console it is working : conky -i1 | awesome-client.
I even tried to add one more "\n" (three in total) and it's doing nothing. Maybe I'm doing something wrong, here is what I do in order :
1- I download conky-cli from aur.archlinux.org
2- I untar it (tar xvf conky-cli...).
3- I edit the file src/conky.c and change the line number 6675 so it looks like this : printf("%s\n\n", s);
4- I download the PKGBUILD and put it in the root folder of the conky-cli folder.
5- I edit the PKGBUILD and comment the md5sum line.
6- I enter this command makepkg -c.
7- I enter this command sudo pacman -U conky-cli.....
As you can see from the output of conky, the extra "\n" seems to do nothing :
$conky
conky_textbox.text = 'Clock: 1.99GHz CPU: 5% Processes/Running: 77/1 Memory: 12%'
conky_textbox.text = 'Clock: 1.99GHz CPU: 10% Processes/Running: 76/2 Memory: 12%'
^Cconky_textbox.text = 'Clock: 1.99GHz CPU: 10% Processes/Running: 76/1 Memory: 12%'
Thank you for your help!
Offline
Did you tar and gzip the source so the makepkg uses it instead of downloading a new package?
Offline
Did you tar and gzip the source so the makepkg uses it instead of downloading a new package?
Thank you!
It was a stupid mistake but it is not explained in the beginner's guide. I thought that I had to download the source from AUR and put the PKGBUILD inside, but the PKGBUILD actually downloads them!
Offline
Glad that worked.
Offline