Plans for the next bspwm edition release

I just figured out, that conky breaks script because lsw lists conky window id first and desktop window id second, but xdotool getmouselocation ignores conky and gives desktop window id. This occurs when conky config has own_window_type = 'desktop'. So I guess it results in two desktop windows at the same time and conky is the lowest of them.
I tried other conky window types and found, that override doesn't work with bspwm, dock and panel show conky over other windows, normal makes conky into normal window, but it is not what I want. Adding own_window_hints = 'below' did not help either.
So at the moment root menu and gap grab don't work with conky. Maybe there is a way to get desktop window id not with lsw? Or somehow sort out what desktop window is really desktop and what is conky window.

EDIT. I can "fix" it if I run
xdotool search --class "conky" set_window --overrideredirect 1 %@
But if conky restarts or refreshes config, it is broken again.

Maybe I should make the script take conky into account... Problem is that since it is run on every mouse click, it needs to be very efficient.

Maybe, I never got to the bottom of this. I just used xcape / xmodmap to use the menu key and wrote a menu to call the other menus.

Can I limit conky to one desktop? Then I could click for menus on another desktop.

A script that checks if you clicked on a window of the class Conky.

Hmm... Does the root window have consistent class? We could check the class and use case statement, including conky, xfdesktop and plain root window. That would be fast enough.

This hack works even if there are more than one conky

rootwindowid=$(($(lsw | sed -n "$(($(xdotool search --class conky|wc -l)+1))p")))
1 Like

Genius!!!!!! Confirmed working here.

And this one works too

rootwindowid=$(($(lsw|grep -v -F "$(xdotool search --class conky|xargs printf '0x%08x\n')"|head -n 1)))

Thanks, I'll do some testing. Us it fast enough? Xdotool search is usually a bit ponderous.

It is quie fast, about 0.015 - 0.020 seconds on my laptop, both variants almost the same.

Is there a better way to look up window class and id?

for class i've been using xprop | grep WM_CLASS. maybe something similar can be done for id?

1 Like

Using xprop I've learnt that desktop has "Bspwm" class, so this line also works and is faster, 0.007 - 0.012 s:

rootwindowid=$(xdotool search --class Bspwm|head -n 1)

I think it will work, because first line is the window at the bottom. man xdotool:

Note that the order of windows in the window stack corresponds to the window stacking order, i.e. the bottom-most window will be reported first

1 Like

Yep, it seems to work and is only 0.002-0.003 seconds slower than the current implementation. That seems quite acceptable.

Maybe this is a bit faster, 0.004-0.012 s.

eval $(xdotool getmouselocation --shell)
[ $WINDOW = $(xdotool search --limit 1 --class Bspwm) ]
1 Like

There is an unusual behavior with gapgrab: when I left-click on empty desktop (with no windows), cursor jumps to the upper left corner of the screen. It might prove handy, because I can quicly open panel menu with the second click, it is just a bit unexpected.

EDIT. Maybe add a check if there is any focused window to prevent this behavior?

focused="$(bspc query -N -n focused)"; [ "$focused" ] || exit
IFS=" " read -a window <<< $(wattr whxy $focused)

That might be good. One useful alternative would be to spawn rofi on empty desktop, but that is even more unexpected.

Updated the root menu. Also updated bspwm-minimal iso in sourceforge. It now has rofi based menus and gap drag enabled.


I wrote a script to use application menu categories with rofi.

1 Like

A post was split to a new topic: Rofi freezes

Forum kindly sponsored by