You are not logged in.
Pages: 1
Hello, help me out please. How do I listen to an XCB events inside a bash script scope?
Offline
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
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
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
Pages: 1