aboutsummaryrefslogtreecommitdiff
path: root/misc/bin/touchpad_toggle.sh
blob: 93bf5e261db6571f499aec10e842fdbdd3fea156 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash
# Toggle the touchpad, if there is one

# Guess the touchpad name
touch_name=$(xinput list --name-only | grep -i touchpad)

if [ -n "$touch_name" ]; then
  if xinput list-props "$touch_name" | grep 'Device Enabled .*:.*1'; then
    xinput set-prop "$touch_name" "Device Enabled" 0
  else
    xinput set-prop "$touch_name" "Device Enabled" 1
  fi
fi