disable touchpad script, keyboard shortcut

For system help, all hardware / software topics NOTE: use Coders Corner for all coders topics.

Moderators: Krom, Grendel

Post Reply
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7737
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

disable touchpad script, keyboard shortcut

Post by Isaac »

Code: Select all

synclient TouchpadOff=$(if [[ $(expr `synclient -l | grep TouchpadOff | cut -f2 -d =`) == 0 ]]; then echo 1; else echo 0; fi) 
I've been trying to make this command work, but it dosen't for some reason. No error message. The script is "executable".

The shortcut key is linked to "/home/isaac/Ubuntu\ One/touchpadoff"

The touch pad stops working for a second when I press the linked key, but then the touchpad starts workign again.

edit:
Putting the command directly into the key command shortcut provides the same result.

:?

edit:
These two commands turn the touch pad on and off, no problem.
$synclient TouchPadOff=0
$synclient TouchPadOff=1
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ :E ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6539
Joined: Sun Sep 05, 1999 2:01 am
Location: ❄️❄️❄️

Re: disable touchpad script, keyboard shortcut

Post by Jeff250 »

In System -> Preferences -> Mouse -> Touchpad, uncheck "Disable touchpad while typing."

edit:
Also, if you need it without bashisms:

Code: Select all

#!/bin/sh
synclient TouchpadOff=$(if [ $(expr `synclient -l | grep TouchpadOff | cut -f2 -d =`) -eq 0 ]; then echo 1; else echo 0; fi)
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7737
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

Re: disable touchpad script, keyboard shortcut

Post by Isaac »

I tried that first option before. Doesn't work well for my setup. My hands still accidentally activate the pad. I just need to turn off the pad when i have the mouse available.

Thanks! The code works!
I now have a "menu" key I never use linked to that script. It's very nice. Thanks.
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ :E ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6539
Joined: Sun Sep 05, 1999 2:01 am
Location: ❄️❄️❄️

Re: disable touchpad script, keyboard shortcut

Post by Jeff250 »

Like I said, uncheck the option. :P
User avatar
Isaac
DBB Artist
DBB Artist
Posts: 7737
Joined: Mon Aug 01, 2005 8:47 am
Location: 🍕

Re: disable touchpad script, keyboard shortcut

Post by Isaac »

Ohhhhh...

Yeah! I was wondering what else I had to do.

The code did disable my touch pad, but for some reason, after a while, it would continue after a while. I think it was that checkbox interfering.

Thanks a ton!
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-★ ·:*¨༺꧁༺ :E ༻꧂༻¨*:·.★-⎽__⎽-⎻⎺⎺⎻-⎽__⎽--⎻⎺⎺⎻-
❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉❉⊱•═•⊰❉⊱•═•⊰❉⊱•═•⊰❉
Post Reply