blob: a71774d3fa6141dc704d1212eb64d9d5aeb080f3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
|