You are not logged in.

#1 2016-09-30 22:16

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,726
Website

Disable touchpad when using usb mouse

How many times do you end up having to write something twice because you nudged the touch-pad on the laptop while typing a long post (or doing some real work!) and the last few sentences / paragraphs are not there when you look up!! Well maybe it's only me it happens to but I decided to write a udev rule to disable my touch-pad when I have my usb mouse plugged in to prevent this happening.
This was quite a simple task but involved using the command line and having three or four terminals open monitoring syslog, udev monitor, one for man pages and one to work in, I thought that many users would think "it's too much hassle and I'll have to be more careful" but I thought what if I make a script to automate the process and set it up for any user, that way I could re-install it easily when i re-install (happens from time to time roll ).
Well here is the script for anyone who wants to do as I have and effectively switch off the touch-pad when the mouse is plugged in.
Just Download the script, make sure it is executable

 chmod +x dais_auto_toggle_script.sh

And then run it from a terminal

./dais_auto_toggle_script.sh

If you have any issues or it doesn't work for you please let me know and I will tell you how to get it working.

This script places a rule in /etc/udev/rules.d and a script in /usr/local/bin which is all that is required to set this up, if you run the script and then decide you want to remove the changes it has made just run the script again and it will detect that the files already exist and give you the choice to remove it. I hope it is quite straight forward to use, but any issues just shout and I'll try and help.


Attachments:
sh dais_auto_toggle_script.sh, Size: 4.07 KiB, Downloads: 152

Offline

#2 2017-03-05 16:07

mc1611
Member
Registered: 2017-02-05
Posts: 4

Re: Disable touchpad when using usb mouse

tryed to run script and got this error.
root@mikespc:/# ./dais_auto_toggle_script.sh
./dais_auto_toggle_script.sh: line 31: kdialog: command not found
./dais_auto_toggle_script.sh: line 35: kdialog: command not found
root@mikespc:/#             
thanks for any help.

Offline

#3 2017-03-05 21:24

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,726
Website

Re: Disable touchpad when using usb mouse

You will need to install kdialog, although it is usually installed I think... Are you using 32 bit or 64 bit, or pi?

Offline

#4 2017-03-05 22:05

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 1,454
Website

Re: Disable touchpad when using usb mouse

If you run 'kdialog' as root, you need to run it with full path:
# /opt/trinity/bin/kdialog

Offline

#5 2017-03-05 22:53

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 1,726
Website

Re: Disable touchpad when using usb mouse

My script doesn't run as root, and I just tested it on my system and it runs fine... I'm wondering if mc1611 is running q4os... or maybe running on a pi. Is kdialog installed on pi (by default)?

EDIT:
Just noticed mc1611 is using root user, that explains it. Just run the script as normal user or alter the script command like Q4OS team suggested.

Last edited by Dai_trying (2017-03-05 22:55)

Offline

Board footer

Powered by FluxBB