You are not logged in.
Pages: 1
Topic closed
I don't know if this is the right forum for this. If it fits better somewhere else, just move it please.
Since I've just begun to learn programming I'm thinking that this endeavour would be a little over my head. But since it's a feature I would really love I'm putting it out here for other people to see. I would like to have the option to make conky text clickable to run any command I choose and I don't see a reason why this hasn't been implemented already. Would it be very complicated from a programming veiwpoint to do this?
Even if no one else is interested in this, I'd really apreciate some short words on how one would go about to implement this. I'm thinking of maybe making this one of my longer term goals in learning to program.
Offline
Personally I think this is an excellent idea. I'm not too sure how conky works internally so I can't give any pointers there, but I know it is able to draw directly on the root window as well as using its own window, in which case this would only work if it was using its own window (as far as I know). I think to implement this idea you will need to find the area of its X11 loop in the source, so that you can catch mouse events and use that to find which text has been clicked. From a programming viewpoint, it shouldn't be too complicated, but I do have a little prior experience using X11 so this may differ for you. If you need some example code for catching the mouse events let me know and I'll see what I can find
Offline
If you or someone else wants to have a go at this (I might do one day if I get bored, but I have no use for it right now), the best place to start is by checking out conky from git:
git clone git://git.omp.am/conky.git
If you then proceed into the conky/src folder you will find the file conky.c, and if you scroll to line 7109 you will see where it is handling the ButtonPress. From here it's a matter of examining the code to find a way of figuring out what goes where so that you can find out what is being hit, if you can get x/y coordinates of the text/image it would be simple from there. I will continue searching and provide any more pointers I can
Edit: Well it all seems to be in that file, particularly generate_text() might be of help on line 5928, and generate_text_internal() as these should show you how to loop over the text objects.
Of course depending on how the lua integration and all that works it might be easier to just specify clickable regions using x/y/width/height and handle that in the ButtonPress part.
Last edited by HashBox (2009-07-06 06:47:46)
Offline
would b of great use with the rss variable, so u could open feeds in browser from clicking conky.
fave quote of the mo': "Man's reach should exceed his grasp, else what's a heaven for." - Robert Browning
Offline
would b of great use with the rss variable, so u could open feeds in browser from clicking conky.
Did you really dig up a 2009 post (its currently 2011 if you haven't noticed) just to post this? Closing. Please don't necro-bump - https://wiki.archlinux.org/index.php/Fo … Bumping.27
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Pages: 1
Topic closed