diff options
author | Andrew Cady <d@jerkface.net> | 2020-01-19 13:54:45 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2020-01-19 13:54:45 -0500 |
commit | 871105cb4a210849c78a94a0a1023c2ed8ff5bc6 (patch) | |
tree | 07f7d3fceee1055790ea55f2c881b635a179cfea /dot | |
parent | efda41ee6705200aa2dfd76542a55de53f0f0a33 (diff) |
add ttoggle
Diffstat (limited to 'dot')
-rwxr-xr-x | dot/local/bin/ttoggle | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/dot/local/bin/ttoggle b/dot/local/bin/ttoggle new file mode 100755 index 0000000..15110e6 --- /dev/null +++ b/dot/local/bin/ttoggle | |||
@@ -0,0 +1,18 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | touchdev=$(xinput list --name-only|grep touch) || exit | ||
4 | |||
5 | touchdev_enabled() | ||
6 | { | ||
7 | xinput list-props "$touchdev" | grep -q '(148):.1$' | ||
8 | } | ||
9 | |||
10 | if touchdev_enabled | ||
11 | then | ||
12 | cmd=disable | ||
13 | else | ||
14 | cmd=enable | ||
15 | fi | ||
16 | |||
17 | set -x | ||
18 | xinput "$cmd" "$touchdev" | ||