From 9d548617a6ff3f85b7731775f4df9b6a6cee3906 Mon Sep 17 00:00:00 2001 From: Christian Klinger Date: Wed, 18 May 2016 13:36:50 +0200 Subject: added sample scripts and README. --- README.md | 24 ++++++++++++++++++++++++ opt/lock.sh | 10 ++++++++++ opt/unlock.sh | 9 +++++++++ 3 files changed, 43 insertions(+) create mode 100644 README.md create mode 100755 opt/lock.sh create mode 100755 opt/unlock.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..4e62449 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +Pool Video Switch 2 +====================================================== +Developer and Integrator documentation +------------------------------------------------------ + +### Configuration files + +### Lock/Unlock Scripts +The functionality of PVS client(`pvsclient`) can be extended by providing +additional shell scripts that are executed on certain events. + +When the PVS client receives the message from the manager to lock the screen it +executes `lock.sh` in the configuration directory (`/opt/openslx/pvs2`). When it +receives an unlock message the client executes `unlock.sh` in the same +directory. + +We suggest to implement additional locking measures in these files. In the +`sample_configuration` folder of this repository you can find 2 scripts that use +`xinput` to disable (enable) the keyboard so that users cannot (even when the +keyboard input is grabbed by VMWare Player) type while the screen is locked. + + +### Network Setup + diff --git a/opt/lock.sh b/opt/lock.sh new file mode 100755 index 0000000..68cbc40 --- /dev/null +++ b/opt/lock.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# use xinput +keyboards=$(xinput --list | grep "slave" | grep "keyboard" | cut -f2 | cut -d'=' -f2) + + +for id in $keyboards; do + echo "disabling device #$id" + xinput --set-prop $id "Device Enabled" 0 +done \ No newline at end of file diff --git a/opt/unlock.sh b/opt/unlock.sh new file mode 100755 index 0000000..f09a2fd --- /dev/null +++ b/opt/unlock.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# use xinput +keyboards=$(xinput --list | grep "slave" | grep "keyboard" | cut -f2 | cut -d'=' -f2) + +for id in $keyboards; do + echo "enabling device #$id" + xinput --set-prop $id "Device Enabled" 1 +done \ No newline at end of file -- cgit v1.2.3-55-g7522