wmutils / core

Set of window manipulation tools
Other
714 stars 33 forks source link

Add xqp to wmutils #52

Closed Chrysostomus closed 7 years ago

Chrysostomus commented 7 years ago

I suggest adding xqp (X Query Pointer) to wmutils. https://github.com/baskerville/xqp

It can be used to determine when pointer is on specific window. This can be used to, for example with sxhkd, binding arbitary commands to clicking desktop. I use it to provide openbox style desktop menus to bspwm.

lwilletts commented 7 years ago

Well, I guess while C code is always nice, I use lsw in underneath.sh under contrib to do the same thing with relatively not much difference in execution unless you were dealing with quite a few windows.

z3bra commented 7 years ago

While this is a nice tool, we are not gonna "steal" it from baskerville. Such a tool is 'out-of-scope' as it can be recreated using the existing tools.

Baskerville wrote many small X utilities that could be "nice" to be found in wmutils. But that's no reason to start merging everything blindly and turn wmutils into a 200+ "cool" X utility mess.

Chrysostomus commented 7 years ago

It would not be stealing, considering baskerville suggested it himself: https://github.com/baskerville/bspwm/issues/595

But your logic about being able to recreate the effect with existing tools is sound, and if that is your criteria for inclusion, this tool obviously does not meet it. Using a script for this seems pretty inefficient (about 6 times slower than xdotool), but is still within reasonable limits.

I respect your choice and philosophy. Thanks for creating these great tools!

z3bra commented 7 years ago

It would not be stealing, considering baskerville suggested it himself: https://github.com/baskerville/bspwm/issues/595

I wasn't aware he mentionned it himself. This tool is indeed useful, but as mentionned earlier, the shell-based version seems to works well-enough. Did you encounter a use case where xqp was "required", as in, underneath.sh was to slow or buggy?

But your logic about being able to recreate the effect with existing tools is sound, and if that is your criteria for inclusion, this tool obviously does not meet it.

It's not as simple as that, for example, both wmv and wrs could be replaced by wtp + wattr. But the use case for them was pretty obvious, so it makes moving and resizing windows a trivial operation thanks to them. IMO, xqp doesn't need to be optimized, and it's not something users will use heavily, or on its own. It will always be coupled with other tools to achieve a greater goal. But hey, maybe there are some use cases that would justify it I didn't think of!

Using a script for this seems pretty inefficient (about 6 times slower than xdotool), but is still within reasonable limits.

How did you measure that? It is fast enough for me so that a comparison can't be done:

$ time underneath.sh
0x00a00001
    0m00.00s real     0m00.00s user     0m00.00s system