Touchpad On/Off shortcut key on Xubuntu 11.04 (eeePC1005HA)

Xubuntu is a great Linux distribution based on the popular Ubuntu. Ubuntu uses Gnome as the desktop environment, and netbook computers are not exactly known as a powerful machines, so I decided to try out alternative solution, the Xfce version of Ubuntu Family –Xubuntu. The combination of Asus eeepc1005HA + Xubuntu 11.04 works great.

Immediately after installation shortcut keys (buttons) work for all except for the touchpad on/off button. I solved this problem with a little script.

Touchpad notifikacija

  • script:
#!/bin/bash
#######################################
# DESCRIPTION: Toggles Touchpad ON/OFF
# DATE: 15.4.2011
# AUTHOR: ssnjara
#######################################
# Check if Touchpad is ON and set "var" acording
var=`synclient | grep TouchpadOff | cut -d\= -f2`
# if ON turn OFF, else turn ON
if [ $var -eq 0 ]
then
synclient TouchpadOff=1
notify-send -i dialog-error "Touchpad disabled!"
else
synclient TouchpadOFF=0
notify-send -i dialog-information "Touchpad enabled!"
fi
#END
  • Copy the script in a text editor and save as “touchpadToggle.sh. After that you need to make a script executable . Open the “Terminal” in the directory containing the script and type:
sudo chmod +x touchpadToggle.sh

Now we have to make a keyboard shortcut to activate the script:

Postavljanje tipkovničke kratice

  • Open the Settings Manager> Keyboard> Application Shortcuts, click on “Add” and in the field command: enter the path to the script or click on the “open” and navigate to the script. When you open the “Command Shortcut” window, press shortcut key to turn off the touchpad.

You just set the touchpad On/Off button to perform its function :) .

Odgovori

Please log in using one of these methods to post your comment:

WordPress.com Logo

Ovaj komentar pišete koristeći vaš WordPress.com račun. Odjava / Izmijeni )

Twitter picture

Ovaj komentar pišete koristeći vaš Twitter račun. Odjava / Izmijeni )

Facebook slika

Ovaj komentar pišete koristeći vaš Facebook račun. Odjava / Izmijeni )

Google+ photo

Ovaj komentar pišete koristeći vaš Google+ račun. Odjava / Izmijeni )

Spajanje na %s

%d bloggers like this: