diff options
author | Jonathan Bauer | 2016-12-23 13:12:09 +0100 |
---|---|---|
committer | Jonathan Bauer | 2016-12-23 13:12:09 +0100 |
commit | 6806ae4a850fc7785a8c05304237cf53b5b8f951 (patch) | |
tree | b1dd8413d6c7b9a250251da7f0d49bb52b4ddc57 /core/modules/pvs2/data/opt/openslx/pvs2/lockDesktop.sh | |
parent | wrong kernel version variable used (diff) | |
download | mltk-6806ae4a850fc7785a8c05304237cf53b5b8f951.tar.gz mltk-6806ae4a850fc7785a8c05304237cf53b5b8f951.tar.xz mltk-6806ae4a850fc7785a8c05304237cf53b5b8f951.zip |
merge with latest dev version (tm-scripts commit f5a59daf8d70a9027118292cd40b18c221897408)
Diffstat (limited to 'core/modules/pvs2/data/opt/openslx/pvs2/lockDesktop.sh')
-rwxr-xr-x | core/modules/pvs2/data/opt/openslx/pvs2/lockDesktop.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/core/modules/pvs2/data/opt/openslx/pvs2/lockDesktop.sh b/core/modules/pvs2/data/opt/openslx/pvs2/lockDesktop.sh new file mode 100755 index 00000000..c9cfc421 --- /dev/null +++ b/core/modules/pvs2/data/opt/openslx/pvs2/lockDesktop.sh @@ -0,0 +1,25 @@ +#!/bin/ash + +# Problem: While any application (e.g. VMware) is holding the mouse and +# keyboard grab, xscreensaver couldn't grab them, so it will ignore the +# locking request. Without the keyboard grab, all input would still go +# to the vmware window below the black screen, which is, you know, bad, +# since you cannot enter your password to unlock the workstation again. + +# So we minimize vmware, lock the screen, and then restore vmware. +# TODO: Add other virtualizers (vbox, kvm) later if needed. +WINDOWS=$(xdotool search --class vmplayer) +for window in $WINDOWS; do + xdotool windowminimize $window +done +# move mouse pointer to the center of the screen to avoid some problems with ghost clicks +xdotool mousemove --polar 0 0 --sync + +# now actually lock +xscreensaver-command --lock + +# above lock call is blocking, so now xscreensaver should be active - let's restore vmware +for window in $WINDOWS; do + xdotool windowmap $window +done + |