From 266cbab12d874e460658d6f327ef8f7eb41ac491 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 6 Sep 2018 14:42:33 +0200 Subject: [xscreensaver] Move pvs2 plugin files to this module --- .../data/opt/openslx/pvs2/addons/50-lock-desktop | 7 ++++++ .../xscreensaver/data/opt/openslx/pvs2/lock.svg | 27 ++++++++++++++++++++++ .../data/opt/openslx/pvs2/lockDesktop.sh | 25 ++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 core/modules/xscreensaver/data/opt/openslx/pvs2/addons/50-lock-desktop create mode 100644 core/modules/xscreensaver/data/opt/openslx/pvs2/lock.svg create mode 100755 core/modules/xscreensaver/data/opt/openslx/pvs2/lockDesktop.sh (limited to 'core/modules/xscreensaver') diff --git a/core/modules/xscreensaver/data/opt/openslx/pvs2/addons/50-lock-desktop b/core/modules/xscreensaver/data/opt/openslx/pvs2/addons/50-lock-desktop new file mode 100644 index 00000000..bde0f2e7 --- /dev/null +++ b/core/modules/xscreensaver/data/opt/openslx/pvs2/addons/50-lock-desktop @@ -0,0 +1,7 @@ +[General] +type=button +exec=/opt/openslx/pvs2/lockDesktop.sh +icon=/opt/openslx/pvs2/lock.svg +caption=Sperren +tooltip=Die Sitzung sperren. Entsperren nur mit Passwort des angemeldeten Benutzers möglich. +async=true diff --git a/core/modules/xscreensaver/data/opt/openslx/pvs2/lock.svg b/core/modules/xscreensaver/data/opt/openslx/pvs2/lock.svg new file mode 100644 index 00000000..09c45511 --- /dev/null +++ b/core/modules/xscreensaver/data/opt/openslx/pvs2/lock.svg @@ -0,0 +1,27 @@ + + + + + + + diff --git a/core/modules/xscreensaver/data/opt/openslx/pvs2/lockDesktop.sh b/core/modules/xscreensaver/data/opt/openslx/pvs2/lockDesktop.sh new file mode 100755 index 00000000..2796de8f --- /dev/null +++ b/core/modules/xscreensaver/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 --onlyvisible --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 --sync --polar 0 0 + +# 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 + -- cgit v1.2.3-55-g7522