bspc query -N -n focused shouldn't be used to get the id focused of the focused window since it may return a node that is not a window.
But xdo id can't be used to get that id either: it fails.
How to reproduce (in bspwm):
- go in an empty desktop;
- open two terminals;
- from one of terminals, run
bspc node @parent -f;
- from the same terminal, run
xdo id; echo "$?" (keep the parent focused while you do it
- the output will be the following (i.e. nothing printed, exit with 1):
pfw from wmutils/core works correctly: outputs the id of the focused (active) window.
xdotool getactivewindow fails exiting with 0 and printing this message to stderr:
XGetWindowProperty[_NET_ACTIVE_WINDOW] failed (code=1)
xdo_get_active_window reported an error
Since xdo is commonly used by bspwm user, I think it should work correctly in this case (like pfw).
bspc query -N -n focusedshouldn't be used to get the id focused of the focused window since it may return a node that is not a window.But
xdo idcan't be used to get that id either: it fails.How to reproduce (in
bspwm):bspc node @parent -f;xdo id; echo "$?"(keep the parent focused while you do itpfwfrom wmutils/core works correctly: outputs the id of the focused (active) window.xdotool getactivewindowfails exiting with 0 and printing this message tostderr:Since
xdois commonly used bybspwmuser, I think it should work correctly in this case (likepfw).