You are not logged in.

#1 2014-03-09 20:35:44

Ploppz
Member
Registered: 2013-09-14
Posts: 313

Conky - makign a script update on an event

Is there a way to make a (bash) script in conky's TEXT update on a certain event? Like, I have this script that monitors my desktops - which desktops are focused, which ones have windows and which ones are empty (using colours). I want the script to update every time the state of the desktops change. And I find it unnecessary to run the script continously with a short delay

${execpi 1 sh /home/ploppz/scripts/conky/d}

This is how I currently do it. One second is even too long. I am using bspwm and sxhkd, so I can control what happens when I'm switching desktops and making and deleting windows. I just need a way to query conky to update that script when the event happens.
Thanks.

Edit: #conky on irc suggested to store the script output in a file that I would let the WM change, and rather just make Conky read that file, but still update_interval can't be less than one second and conky isn't made for this purpose.

Can anyone however suggest another bar that could do what I wanted?

Last edited by Ploppz (2014-03-09 21:05:48)

Offline

#2 2014-03-10 08:23:44

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: Conky - makign a script update on an event

Long shot, but:

Environment Variables

BSPWM_SOCKET
The path of the socket used for the communication between bspc and bspwm. If it isn’t defined, then the following path is used: /tmp/bspwm<display_name>-socket.

Maybe use a script that utilizes inotifywait on that socket (hoping that it only responds to window changes, who knows) and update based on that. This way, you could get even driven updates.


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#3 2014-03-10 14:28:10

karkhaz
Member
Registered: 2014-01-25
Posts: 79

Re: Conky - makign a script update on an event

Ploppz wrote:

Can anyone however suggest another bar that could do what I wanted?

i3bar takes input as a JSON-formatted string. It updates itself whenever it gets a new string, and there is no limit on the frequency that you can send strings to it. This would be ideal for you; instead of checking a file every second, you make your script update i3bar whenever your desktop changes.

i3bar is part of the i3 window manager, but can be run separately as far as I know. By default, it takes input from a program called i3status, but of course you could generate your own JSON strings if you want. If you want to see what the input of i3bar should look like, install i3status and run it in a terminal.

Offline

Board footer

Powered by FluxBB