blob: c411bfec92a94c7db8b453a4c982ae93aa28186e (
plain) (
tree)
|
|
#!/bin/ash
wfile="/run/user/$(id -u)/vmwins"
if [ "$1" = "pre" ]; then
# Find all vmware windows currently visible
WINDOWS=$(xdotool search --onlyvisible --class vmplayer)
[ -z "$WINDOWS" ] && exit 0
for window in $WINDOWS; do
xdotool windowminimize $window
echo "$window" >> "$wfile" # Remember for later
done
# move mouse pointer around to avoid some problems with ghost clicks
# also this resets the idle time durr hurr
xdotool mousemove 0 0
usleep 10000
xdotool mousemove --polar 0 0
usleep 10000
xdotool key "ctrl+alt+shift+super"
usleep 10000
fi
if [ "$1" = "post" ]; then
# let's restore vmware
WINDOWS=$(sort -u "$wfile")
for window in $WINDOWS; do
xdotool windowmap $window
done
fi
exit 0
|