From e5fa9c77d34bce0291e1ec713bab95d7803352bf Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 10 Feb 2017 15:40:29 +0100 Subject: [sample_configuration] kb-lock: Disable mouse too --- sample_configuration/kb-lock.sh | 6 +++--- sample_configuration/kb-unlock.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sample_configuration') diff --git a/sample_configuration/kb-lock.sh b/sample_configuration/kb-lock.sh index 68cbc40..36a84c8 100755 --- a/sample_configuration/kb-lock.sh +++ b/sample_configuration/kb-lock.sh @@ -1,10 +1,10 @@ #!/bin/bash -# use xinput -keyboards=$(xinput --list | grep "slave" | grep "keyboard" | cut -f2 | cut -d'=' -f2) +# use xinput to get all keyboards and pointers (mouse) +keyboards=$(xinput --list | grep -E "slave.*(keyboard|pointer)" | 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 +done diff --git a/sample_configuration/kb-unlock.sh b/sample_configuration/kb-unlock.sh index f09a2fd..09dc270 100755 --- a/sample_configuration/kb-unlock.sh +++ b/sample_configuration/kb-unlock.sh @@ -1,9 +1,9 @@ #!/bin/bash -# use xinput -keyboards=$(xinput --list | grep "slave" | grep "keyboard" | cut -f2 | cut -d'=' -f2) +# use xinput to get all keyboards and pointers (mouse) +keyboards=$(xinput --list | grep -E "slave.*(keyboard|pointer)" | 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 +done -- cgit v1.2.3-55-g7522