-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtoggleTouchscreen
More file actions
executable file
·24 lines (20 loc) · 880 Bytes
/
toggleTouchscreen
File metadata and controls
executable file
·24 lines (20 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
## -------------------------------------------------------------------
## Touchscreen enabled status toggler 1.0.0
##
## This is free software: you are free to change and redistribute it.
## There is NO WARRANTY, to the extent permitted by law.
## -------------------------------------------------------------------
### Toggles whether or not the touchscreen is enabled
### Usage: toggleTouchscreen
###
### -h, --help Show help options.
### -v, --version Print program version.
help=$(grep "^### " "$0" | cut -c 5-)
version=$(grep "^## " "$0" | cut -c 4-)
eval "$(docopts -A args -h "$help" -V "$version" : "$@")"
if [[ $(xinput list-props 'ELAN Touchscreen' | grep Enabled | egrep -o "\s+(0|1)$" | sed -r "s/\s+//g") == 0 ]]; then #Touchpad is off, turn it on
xinput enable 'ELAN Touchscreen'
else
xinput disable 'ELAN Touchscreen'
fi