Results 1 to 2 of 2
Summary: How to turn a touchpad on and off with ease in the GNOME Desktop Environment. Turning a touchpad on and off is not provided as an easy option in ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-01-2007 #1
Turning a touchpad on and off in GNOME - Tutorial
Turning a touchpad on and off is not provided as an easy option in GNOME by default. This can be corrected with a simple shell script.
Firstly ensure that the line 'Option "ShmConfig" "true"' is included under the touchpad section of your '/etc/X11/xorg.conf' file. This section should look something like this:
Section "InputDevice" Identifier "Synaptics Touchpad" Driver "synaptics" Option "SendCoreEvents" "true" Option "Device" "/dev/psaux" Option "Protocol" "auto-dev" Option "HorizScrollDelta" "0" Option "ShmConfig" "true" EndSection
question="`synclient -l | grep TouchpadOff`" if [[ $(echo $question | tr -d ' ') == 'TouchpadOff=1' ]] then synclient TouchpadOff=0 else synclient TouchpadOff=1 fi
Creating Keyboard Shortcuts
Summary: How to create a key binding (keyboard shortcut) in the GNOME Desktop Environment.
You'll need to ensure that you have the 'Configuration Editor'. In Debian GNU/Linux this is usually located under 'Applications -> System Tools -> Configuration Editor'.
In the configuration editor go to the metacity part ('/ -> apps -> metacity').
Under 'keybinding_commands' select anything from command_1 to command_10 and give it the value 'sh <Location of shell script>' or whatever command you want command_x to run. For example say you wanted to run a shell script to turn your touch pad on and off (see here), I could type 'sh /home/username/.custom/tps.sh'.
Now that we have told command_x to run a command when initiated (lets assume command_x is command_1 for now), we then need to give it a key binding. To do this go to 'global_keybindings' and select the corresponding attribute (Name), e.g. run_command_1 in this case. KDE uses the key combination Ctrl+Alt+q to turn on/off their touchpad so lets do the same here. Give run_command_1 the value '<Ctrl><Alt>q'.
Adding Custom Command Line Commands
Summary: How to add custom command line commands.
This tutorial will be split into two parts. Part one will show you how to give a command another name so you can call it up more easily. Part 2 will show you how to add a shell script as if its a command.
Part 1: Giving a command more names.
Simply create a symbolic link in the '/usr/bin' directory to the same program. For example if I wanted to make the command 'gnome-terminal' able to be called by typing 'cmd' I would make the following symbolic link (you must be in super-user mode ('$ su -')):
# ln -s /usr/bin/gnome-terminal /usr/bin/cmd
Part 2: Running shell scripts as a command.
A similar task needs to be done here however the shell script is copied to the '/usr/bin' directory. There is no need for the '.sh' extension to the script command as that will only add the need to type more. Taking the example of the touchpad switcher (tps for short), lets make this into a command line command.
# cp /home/username/.custom/tps.sh /usr/bin/tps
For anyone you might have had questions on this, I hope it has helped and that I haven't been too over wordy lol.
- 10-03-2007 #2
- Join Date
- Sep 2007
excellant tutorial. thanks