diff options
Diffstat (limited to 'core/modules/vmware12')
-rwxr-xr-x | core/modules/vmware12/data/opt/openslx/xscreensaver/ungrab.d/vmware | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/core/modules/vmware12/data/opt/openslx/xscreensaver/ungrab.d/vmware b/core/modules/vmware12/data/opt/openslx/xscreensaver/ungrab.d/vmware new file mode 100755 index 00000000..a71774d3 --- /dev/null +++ b/core/modules/vmware12/data/opt/openslx/xscreensaver/ungrab.d/vmware @@ -0,0 +1,28 @@ +#!/bin/ash + +wfile="/run/user/$(id -u)/vmwins" + +if [ "$1" = "pre" ]; then + # Find all vmware windows currently visible + WINDOWS=$(xdotool search --onlyvisible --class vmplayer) + 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 +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 |