soft toggle a touchpad in XFCE

I have an ASUS U46E and the touchpad hotkey does not yet function at all. I made a hotkey under Settings->Keyboard->Application Shortcuts, Ctrl+Alt+9 to launch this script because Fn and F9 are in the vicinity anyway.

/usr/local/bin/toggle_touchpad.sh:

#!/bin/bash
name="BYD"
tp=`xinput list|grep "$name"|awk -F= '{print $2}'|awk '{print $1}'`
state=`xinput list-props $tp|grep 'Device Enabled'|awk -F\: '{print $2}'|awk '{print $1}'`
(( $state )) && xinput disable $tp || xinput enable $tp

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s