Hi,
I've packaged skippy-xd, a full screen exposé-style task switcher:
https://github.com/richardgv/skippy-xd
and added a script that gives focus to the window switched by the user, and tries to center it on the screen afterwards.
In most cases, the last step succeeds, but not always. This is the case when part of the window is offscreen.
The window will gain input focus, but the script might fail to moving it to the center.
This is the script I need to improve:
#!/bin/bash
skippy-xd
IFS='x' read sw sh < <(xdpyinfo | grep dimensions | grep -o '[0-9x]*' | head -n1)
WINDOW_ID=$(xdotool getactivewindow)
read wx wy ww wh < <(wmctrl -lG | grep $(printf 0x%x $WINDOW_ID | cut -d'x' -f2) | sed 's/^[^ ]* *[^ ]* //;s/[^0-9 ].*//;')
wmctrl -r :ACTIVE: -e 0,$(($sw/2-$ww/2)),$(($sh/2-$wh/2)),$ww,$wh
wmctrl -i -a :ACTIVE:
:
And here you are a video:
https://www.gnuinos.org/shared/skippy-xd.mkv
Cheers,
Aitor.