diff options
author | Christian Pointner <equinox@spreadspace.org> | 2020-12-30 19:13:04 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2020-12-30 19:13:04 +0100 |
commit | a69ff5ee98160b2534a867845ca1f1bfe2fefab9 (patch) | |
tree | d3e7abbd185313fe74f8b1af29dfb63d48e1029b /chaos-at-home/ch-equinox-t450s.yml | |
parent | ws/minet: add even more connection scripts (diff) |
ch-equinox-t450s: some finishing touches
Diffstat (limited to 'chaos-at-home/ch-equinox-t450s.yml')
-rw-r--r-- | chaos-at-home/ch-equinox-t450s.yml | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/chaos-at-home/ch-equinox-t450s.yml b/chaos-at-home/ch-equinox-t450s.yml index e60d47a9..a63798f4 100644 --- a/chaos-at-home/ch-equinox-t450s.yml +++ b/chaos-at-home/ch-equinox-t450s.yml @@ -20,3 +20,48 @@ - name: install ansible via pip pip: name: ansible + + - name: disable caps-lock + lineinfile: + path: /etc/default/keyboard + regexp: '#?\s*XKBOPTIONS=' + line: 'XKBOPTIONS="caps:none"' + + ## TODO install autostart and keyboard shortcut Ctrl+P + - name: install touchpad control script + copy: + dest: /usr/local/bin/touchpadctl + mode: 0755 + content: | + #!/bin/bash + + ID=$(xinput list | grep "SynPS/2 Synaptics TouchPad" | sed 's/^.*id=\([0-9]*\).*$/\1/') + if [ -z "$ID" ]; then + ID=$(xinput list | grep "Synaptics TM3053-004" | sed 's/^.*id=\([0-9]*\).*$/\1/') + fi + + if [ -z "$ID" ]; then + echo "cannot find device!" + exit 1 + fi + + if [ -n "ID" ]; then + case $1 in + enable|disable) + xinput $1 $ID + ;; + toggle) + CURRENT_STATE=$(xinput list-props $ID | grep 'Device Enabled' | awk 'BEGIN { FS = ":" } ; { print $2 }' | sed 's/^.*\([01]\).*$/\1/') + if [ $CURRENT_STATE -ne 1 ]; then + xinput enable $ID + else + xinput disable $ID + fi + ;; + *) + echo "usage: $0 (enable|disable|toggle)" + ;; + esac + else + echo "Touchpad not found..." + fi |