summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md24
-rwxr-xr-xopt/lock.sh10
-rwxr-xr-xopt/unlock.sh9
3 files changed, 43 insertions, 0 deletions
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