Discussion:
unknown
1970-01-01 00:00:00 UTC
Permalink
In .fluxbox/keys:
OnWindow Mod1 Mouse2 :MacroCmd {Lower} {ExecCommand focus-top}
... or whatever keystroke you like. I like Alt-Mouse1 to pop the
window to the front and Alt-Mouse2 to pop it to the back. YMMV.

Then in a file 'focus-top' somewhere on your path:

#!/usr/bin/env bash
# use xdotool to give focus to the topmost window containing the cursor:
eval $( xdotool getmouselocation --shell )
X_CURSOR=$X
Y_CURSOR=$Y
HIT=
# note that xdotool search displays the windows with the topmost window last:
for WIN in $( xdotool search --desktop $( xdotool get_desktop) . ); do
eval $( xdotool getwindowgeometry --shell $WIN )
(( X_CURSOR >= X && ( X_CURSOR <= X + WIDTH ) && Y_CURSOR >= Y &&
( Y_CURSOR <= Y + HEIGHT) )) && HIT=$WIN
done
[[ "$HIT" ]] && xdotool windowfocus $HIT

... seems to work for me ... don't forget to 'chmod +x focus-top'

Cheers



Bob

Continue reading on narkive:
Loading...