SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-01-09 14:04:17

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Toggle synaptics touchpad

I was searching for a way to toggle my touchpad on and off...
I found this thread, which didn't solve it for me...
http://crunchbanglinux.org/forums/topic … -touchpad/

So i made a small script toggletouchpad.sh

#!/bin/bash
if [ $(synclient -l | grep TouchpadOff | awk '{print $3}') == 1 ] ; then
synclient touchpadoff=0;
else
synclient touchpadoff=1;
fi

In rc.xml i assigned the program to Winkey-p:

 <keybind key="W-p">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>toggletouchpad</name>
        </startupnotify>
        <command>toggletouchpad.sh</command>
      </action>
    </keybind>

If there's a better way to do this, please let me know...
Tuna


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

Help fund CrunchBang, donate to the project!

#2 2011-01-09 16:07:12

Penguin Skinner
Member
Registered: 2010-12-25
Posts: 33

Re: Toggle synaptics touchpad

On my Toshiba the touchpad has a nasty habit of re-enabling itself, so I use the more durable approach of unloading the psmouse module:

#!/bin/sh
if xinput list-props "SynPS/2 Synaptics TouchPad" | grep "Device Enabled" | grep 1 > /dev/null 2>&1
then 
        modprobe -r psmouse > /dev/null 2>&1
        echo "Touchpad disabled"
else
        modprobe psmouse > /dev/null 2>&1
        echo ""
        echo "Touchpad now enabled"
fi

Of course you need root permission to use modprobe, but that isn't a problem since I always have a root shell open.

Last edited by Penguin Skinner (2011-01-09 16:16:27)

Offline

#3 2011-01-09 16:27:12

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: Toggle synaptics touchpad

Penguin Skinner wrote:

Of course you need root permission to use modprobe, but that isn't a problem since I always have a root shell open.

I wanted something without root permission (so i could use it with openbox keybindings). And i didn't want to add modprobe to the sudoers file.
I didn't experience the re-enabling problem yet....
Tuna


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

#4 2011-01-09 16:35:13

Penguin Skinner
Member
Registered: 2010-12-25
Posts: 33

Re: Toggle synaptics touchpad

Tunafish wrote:

I didn't experience the re-enabling problem yet....
Tuna

Hope you don't! It's unbelievably annoying to be typing along and suddenly there's mayhem on your desktop. smile

Offline

#5 2011-01-09 16:56:16

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: Toggle synaptics touchpad

Penguin Skinner wrote:

Hope you don't! It's unbelievably annoying to be typing along and suddenly there's mayhem on your desktop. smile

I actually had a different reason for this small script. I have a on/off switch on my touchpad, so i can switch it off when i'm not using it. The problem is when i switch it on, it sends a repeating equal sign =================================== which only stops when i press enter.


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

#6 2011-03-22 16:08:53

Tunafish
#! Die Hard
From: the Netherlands
Registered: 2010-03-07
Posts: 1,204

Re: Toggle synaptics touchpad

As i experienced the same problem as Penquin Skinner, i now use a different method:

#!/bin/bash

if [ $(xinput list-props  "AlpsPS/2 ALPS GlidePoint" | grep "Device Enabled"  | awk '{print $4}') -eq 1 ]; then
#if [ $(synclient -l | grep TouchpadOff | gawk -F '= ' '{ print $2 }') -eq 0 ]; then
    #synclient TouchpadOff=1
    xinput set-int-prop "AlpsPS/2 ALPS GlidePoint" "Device Enabled" 8 0
    notify-send "touchpad disabled"
else
    #synclient TouchpadOff=0
    xinput set-int-prop "AlpsPS/2 ALPS GlidePoint" "Device Enabled" 8 1
    notify-send "touchpad enabled"
fi

This seems to work... (till now)
Tuna


sed 's/stress/relaxation/g'
Privacy & Security on #!

Offline

#7 2011-03-22 19:49:15

tartan
#! Junkie
From: Moscow
Registered: 2009-07-13
Posts: 314

Re: Toggle synaptics touchpad

I had the same problem and I first tried to use syndaemon, but it would disable two-finger tap which I use for root window menu, so now when I type a lot I just unload mouse drivers module (I had a couple of free fn keys on my laptop) and it works like charm. And it makes me use more vim commands and keeps me away from random browsing the web. Love this option. ))

Offline

#8 2011-03-22 22:41:34

bozhkov
#! Junkie
Registered: 2009-12-29
Posts: 463

Re: Toggle synaptics touchpad

What about if everything works initially, but just "dies" after switching the touchpad on/off?

Offline

#9 2011-03-23 02:57:55

tranche
#! CrunchBanger
Registered: 2011-02-04
Posts: 111
Website

Re: Toggle synaptics touchpad

Here's the one I use.  It's pretty similar

#!/bin/bash 
# toggle touchpad on and off on asus 1015pem
# based on one by sg3524 and c901906 at 
# ubuntu forums "elantech touchpad improperly recognized ..."
#
#
# use 'xinput list' and 'xinput list-props' to find
# the correct local value for $PAD

PAD='ETPS/2 Elantech Touchpad'

A=`xinput list-props "$PAD" | sed -n -e 's/.*Device Enabled ([0-9][0-9]*):\t\(.*\)/\1/p' `

# echo "A =" $A
if [ $A -eq 1 ]; then
      xinput set-int-prop "$PAD" "Device Enabled" 8 0
else
      xinput set-int-prop "$PAD" "Device Enabled" 8 1
fi

Offline

#10 2011-11-30 00:56:41

dtigue
New Member
Registered: 2009-09-23
Posts: 4
Website

Re: Toggle synaptics touchpad

I have aliases set up to disable mine.

alias mouseon='sudo modprobe psmouse'
alias mouseoff='sudo modprobe -r psmouse'

but this is for a Google cr48.

My problem is with enabled the tap feature instead of a hard click, but the multi-touch for scrolling works out of the box. If only the tap feature would work I would have a perfect #! setup on a Google Chrome cr48, with a flashed intel bios wink

Offline

#11 2011-11-30 09:46:46

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: Toggle synaptics touchpad

seeing how we're reviving the thread for a bit, the least i can do is post a link to my own how-to for disabling your synaptics touchpad when an USB-mouse is connected: http://crunchbanglinux.org/forums/topic … connected/

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo