• Aquí vive el Software Libre, coje lo que quieras, da lo que puedas
  • Rápido, seguro, libre e increíblemente fácil de usar
  • Ubuntu: Linux para seres humanos
  • Linux es Educación. Linux es Ciencia
  • Ubuntu es diseño, Ubuntu es innovación
  • Keep calm and enjoy Ubuntu
  • Trata tu teclado como se merece con Ubuntu
  • pf-kernel para Ubuntu
  • Convierte tu iMac en un ordenador de verdad
  • La libertad no es poder elegir entre unas pocas opciones impuestas
  • Software libre, para una sociedad libre

Sscript para deshabilitar el touchpad en Ubuntu 10.04

Entrada escrita por: Fernando Lanero Barbero
Por fin podemos leer en Trucos Ubuntu cómo desactivar el Touchpad de nuestro portátil de forma rápida, sencilla e, incluso, automática (sí, habéis leído bien: automática) ;-)

Edu, nos cuenta en su entrada "Touchpad", cómo podemos desactivar este dispositivo de nuestro PC mediante la ejecución de un script, el cual podemos descargarlo desde aquí.



También os dejo el script completo por si alguien quiere crear su propio fichero script.sh:

#!/bin/bash
#El script MANUAL se encarga de desactivar y activar el touchpad cuando se presiona la combinacion seleccionada
#El script AUTO se encarga de revisar si hay algun raton conectado, y si es asi, desactiva el touchpad
gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_auto-disable true
echo "Generando los scripts"
MANUAL=touchpad-manual
AUTO=touchpad-auto
zenity --question --text="¿Desea activar las notificaciones?\nSe instalara el paquete libnotify-bin\npara lanzar notificaciones a traves de Notify-OSD"
if [ $? = 0 ];then
    gksu echo Instalando
    sudo apt-get install libnotify-bin
    gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_notify true
else
    gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_notify false
fi
echo '#!/bin/bash
gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_auto-disable false
#Si el estado actual es activado, lo desactiva, si no, lo activa
if [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_enabled) = true ]; then
    gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_enabled false
    #synclient TouchpadOff=1
    if [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_notify) = true ]; then
        notify-send --icon=mouse "Touchpad Deshabilitado"
    fi
else
    gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_enabled true
    #synclient TouchpadOff=0
    if [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_notify) = true ]; then
        notify-send --icon=mouse "Touchpad Habilitado"
    fi
fi' | tee $MANUAL

echo '#! /bin/bash
# Depende de libnotify-bin
notify=0    # Deshabilita la notificacion en el arranque
# Sincroniza synclient con gconf
#if [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_enabled) = true ]; then
#    synclient TouchpadOff=0
#elif [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_enabled) = false ]; then
#    synclient TouchpadOff=1
#fi
while [ 1 ]
do
    if [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_auto-disable) = true ]; then
        if [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_enabled) = true ] && [ -e /dev/input/by-id/*event-mouse ]; then # Se enchufa un Ratón
            gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_enabled false
            #synclient TouchpadOff=1
            if [ $notify = 1 ]; then
                notify-send --icon=mouse "Touchpad Deshabilitado" "Se ha detectado un Ratón externo"
            fi

        elif [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_enabled) = false ] && [ ! -e /dev/input/by-id/*event-mouse ]; then # Se desenchufa un Ratón
            gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_enabled true
            #synclient TouchpadOff=0
            if [ $notify = 1 ]; then
                notify-send --icon=mouse "Touchpad Habilitado" "Se ha desconectado el Ratón externo"
            fi
        fi
    fi
    if [ $(gconftool-2 --get /desktop/gnome/peripherals/touchpad/touchpad_notify) = true ]; then
        notify=1
    fi
    sleep 5  # Periodo de refresco en segundos
done' | tee $AUTO

echo "Instalando los script"
gksu cp $MANUAL /usr/bin/
rm $MANUAL
sudo cp $AUTO /usr/bin/
rm $AUTO
cd /usr/bin/
sudo chmod +rx $MANUAL
sudo chmod +rx $AUTO

echo "Asociando combinacion de teclas Alt+t"
gconftool-2 -t str --set /apps/metacity/global_keybindings/run_command_8 "t"
gconftool-2 -t str --set /apps/metacity/keybinding_commands/command_8 "$MANUAL"
echo "Asociando combinacion de teclas Alt+a para el modo automático"
gconftool-2 -t str --set /apps/metacity/global_keybindings/run_command_7 "a"
gconftool-2 -t str --set /apps/metacity/keybinding_commands/command_7 "gconftool-2 --type boolean --set /desktop/gnome/peripherals/touchpad/touchpad_auto-disable true"

echo "Creando autoarranque"
cd /usr/share/gnome/autostart/
echo '[Desktop Entry]' | sudo tee $AUTO.desktop
echo 'Type=Application' | sudo tee -a $AUTO.desktop
echo 'Name=AutoDeshabilitar Touchpad' | sudo tee -a $AUTO.desktop
echo "Exec=$AUTO" | sudo tee -a $AUTO.desktop
echo 'Icon=mouse' | sudo tee -a $AUTO.desktop
echo 'Comment=Detecta si exixte un raton, y si es asi, deshabilita el touchpad' | sudo tee -a $AUTO.desktop
echo "Listo"


Fuente: Trucos Ubuntu: Touchpad

6 comentarios:

Anónimo dijo...

gracias, me funcionó,
para que funcione hay que abrir una terminal
cambiarte al directorio donde esta guardado el archivo touchpad.sh
despues teclear
sh touchpad.sh
decir que si a lo que se pregunta, y cuando termine hay que hacer alt-t para desactivar el touchpad.

Unknown dijo...

MUCHAS GRACIAS POR ESTE APORTE, ME FUNCIONO A LA PERFECCIÓN. QUE VIVA EL SOFTWARE LIBRE Y LA COMUNIDAD GNU/LINUX

Anónimo dijo...

como puedo desinstalarlo???
no me permite escribir "a" o "t", lo q hace es deshabilitar o activar

Anónimo dijo...

Gracias.

Si te pasa como a mí que te basta con el touchpad del portátil (no necesitas ratón) pero no te gusta que funcionen las pulsaciones pues te fastidian al navegar en internet, etc. las puedes deshabilitar dejando pulsada la tecla ALT, pulsando F2, poniendo gnome-mouse-properties, pulsando Enter, pulsando en la pestaña Touchpad, quitando la marca junto a "Activar pulsaciones del ratón con el touchpad" y pulsando en Cerrar.

Para hacer lo contrario se vuelve a poner la marquita.

Los comandos que tienen el mismo efecto son:
synclient MaxTapTime=0
o
synclient TapButton1=0 TapButton2=0 TapButton3=0
o
xinput set-prop "nombredeldispositivo" "Synaptics Tap Time" 0 ( p.e. xinput set-prop "AlpsPS/2 ALPS GlidePoint" "Synaptics Tap Time" 0 )
o
xinput set-prop x --type=int y 0 ( p.e. xinput set-prop 12 --type=int 292 0 )
o
xinput set-prop "nombredeldispositivo" "Synaptics Tap Action" 0, 0, 0, 0, 0, 0, 0 ( p.e. xinput set-prop "AlpsPS/2 ALPS GlidePoint" "Synaptics Tap Action" 0, 0, 0, 0, 0, 0, 0 )
o
xinput set-prop x --type=int z 0, 0, 0, 0, 0, 0, 0 ( p.e. xinput set-prop 12 --type=int 313 0, 0, 0, 0, 0, 0, 0 )

Para dejarlos como estaban:
synclient MaxTapTime=180
o
synclient TapButton1=1 TapButton2=3 TapButton3=2
o
xinput set-prop "nombredeldispositivo" "Synaptics Tap Time" 180 ( p.e. xinput set-prop "AlpsPS/2 ALPS GlidePoint" "Synaptics Tap Time" 180 )
o
xinput set-prop x --type=int y 180 ( p.e. xinput set-prop 12 --type=int 292 180 )
o
xinput set-prop "nombredeldispositivo" "Synaptics Tap Action" 2, 3, 0, 0, 1, 3, 2 ( p.e. xinput set-prop "AlpsPS/2 ALPS GlidePoint" "Synaptics Tap Action" 2, 3, 0, 0, 1, 3, 2 )
o
xinput set-prop x --type=int z 2, 3, 0, 0, 1, 3, 2 ( p.e. xinput set-prop 12 --type=int 313 2, 3, 0, 0, 1, 3, 2 )

Se pueden ejecutar desde ALT+F2 o desde terminal o poner como atajos de teclado (con gnome-keybinding-properties) o poner en scripts.

Para saber los números x, y, z y el texto "nombredeldispositivo" se usan:
1º xinput list (x es el número tras id= de la línea que diga algo de Alps o Synaptics, texto que es precisamente "nombredeldispositivo")
2º xinput list-props x|grep -i tap (en vez de x se pone el número que sea. En vez del número se puede poner el texto con Alps o Synaptics entre comillas) (y es el número entre paréntesis de la línea que dice "Synaptics Tap Time"; z es el número entre paréntesis de la línea que dice "Synaptics Tap Action")

Más información, en inglés: http://ubuntuforums.org/showthread.php?t=1567479

========================

Sacado de http://www.ubuntu-es.org/node/154732

Anónimo dijo...

A) Respecto a todo el touchpad:

También se puede desactivar el touchpad con:
gconftool-2 -s -t bool /desktop/gnome/peripherals/touchpad/touchpad_enabled false
Y activar con:
gconftool-2 -s -t bool /desktop/gnome/peripherals/touchpad/touchpad_enabled true
Sacado de ubuntulife.wordpress.com/2010/10/06/script-para-desactivar-el-touchpad/

También se puede desactivar con:
sudo modprobe -r psmouse
Para reactivarlo:
sudo modprobe -i psmouse
o
sudo modprobe psmouse
Sacado de andaravelasvir.com/2010/08/28/desactivar-el-touchpad-en-kubuntu/

También se puede desactivar con:
1º xinput list
2º xinput set-prop x “Device Enabled” 0 (en vez de x el valor de id del touchpad)
Para reactivarlo: xinput set-prop x “Device Enabled” 1
Sacado de ubuntumexico.com/2011/03/como-desactivar-el-touchpad-en-ubuntu/

También creo que se puede como dice ubuntu-cosillas.blogspot.com/2011/02/habilitardeshabilitar-el-touchpad-del.html

B) Sólo respecto a las pulsaciones de ratón del touchpad:

Se puede usar un pequeño script para que al pulsar una combinación de teclas se desactiven las pulsaciones del ratón y al volver a pulsar la misma combinación se vuelvan a activar.

El script sería así (para device, en vez de 12 cada uno tiene que poner el valor de su x y para property en vez de 313 el de su z):

#!/bin/bash

device=12
property=313
mode="$(xinput list-props $device | grep $property | cut -d',' -f5)"

if [ $mode -eq "1" ] ;
then
xinput set-prop $device $property 0, 0, 0, 0, 0, 0, 0
else
xinput set-prop $device $property 2, 3, 0, 0, 1, 3, 2
fi

Al script hay que darle permiso de ejecución. Se puede guardar (como root o administrador) en /usr/bin, para poder ser llamado desde la combinación de teclas que se elija en gnome-keybinding-properties.

Anónimo dijo...

echo "Asociando combinacion de teclas Alt+a para el modo automático"
gconftool-2 -t str --set /apps/metacity/global_keybindings/run_command_7 "a"

no es ALT + a es solo a por lo cual bloquea la tecla a...
cambienla por una tecla q no utilizen y cero drama... lo mismo con la letra t