You are not logged in.

#1 2017-03-10 20:49:48

little-boy
Member
Registered: 2017-03-08
Posts: 19

Bash scripting and XCB

Hello, help me out please. How do I listen to an XCB events inside a bash script scope?

Offline

#2 2017-03-11 08:47:23

ayekat
Member
Registered: 2011-01-17
Posts: 1,589

Re: Bash scripting and XCB

Have you taken a look at xev?

Otherwise, what exactly is your goal? If it is still this, you are really better off asking the WM developers - everything else would just be an ugly hack.


pkgshackscfgblag

Offline

#3 2017-03-11 11:33:15

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Bash scripting and XCB

There are no such things as XCB events.  XCB is a library that implements the client side of the X11 protocol (which includes events).  That library has no bash bindings: only C, perl, and python.

If your question is really how to listen to X11 events from bash, that is a much more general question with a little more potential.  Still there are no bash bindings for any library that implements the X11 protocol.  I suspect the above mentioned xev is the closest you'll get and that'd be horribly impractical to parse the output from (it'd be a very ugly and fragile hack).

If you want to respond to X11 events, you should use a language with proper bindngs to a library that implements the X11 protocol (Xlib/XCB).  Xlib in C is actually quite strait forward, but if you want to stick with a scripting language, python has bindings for both of these libraries.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2017-03-15 00:38:46

little-boy
Member
Registered: 2017-03-08
Posts: 19

Re: Bash scripting and XCB

Thanks for your replies, boys. I did a research and now things are clearer to me. While I can not dedicate the time to learn programming in C and that includes a exclusive research for X11 protocol too, in my case, I came up with a workaround which is not working well either. Well, as soon as I have the time, hopefully. I would gladly contact developers, unfortunately, looking at openbox bugzilla, it takes years for developers to fix some issues, so it is better to find a workaround and present a solution than to wait for someone even too look at my report.

Offline

#5 2017-05-25 19:56:41

adam_danischewski
Banned
Registered: 2016-05-06
Posts: 23
Website

Re: Bash scripting and XCB

If you want to look at something working that is open source and listens on X-Windows events you can get a copy of devils pie (old, yet still works well, it hooks X-Windows events): https://github.com/plaes/devilspie

Afterward, you can probably hack it/write something on your own using the XCB API:
https://xcb.freedesktop.org/PublicApi/

Offline

Board footer

Powered by FluxBB