LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to enable/disable the touchpad when connecting an external mouse?
#1
Hi there everybody!
I'm trying to do something so mi laptop disables the TouchPad when I connect the external Mouse and enables it again when I disconnect the mouse. So far I got the bash script for each action.
Searching the web I discovered that with udev I can do that. But so far it doesn't work. So I come here for some help.
NOTE:
I have to say that I had to change systemd with upstart and lightDM with SDDM in order to make Linux Lite work in my computer (with Ubuntu, my computer only works with Kubuntu and upstart). Unfortunately I'm not that an advance user to explain this, but it just works this way.
Ok, now that everything is explained here comes the things I've done:

First I create the scripts to disable the touchpad
Code:
#!/bin/sh
# Get the id number of the touchpad.
tp_id=`xinput list | grep -i touchpad | awk '{ print $6 }' | sed 's/id=//'`
xinput disable $tp_id

and the script to enable it
Code:
#!/bin/sh
# Get the id number of the touchpad.
tp_id=`xinput list | grep -i touchpad | awk '{ print $6 }' | sed 's/id=//'`
xinput enable $tp_id

I made the rule in /etc/udev/rules.d/10-personal.rules:

  [Image: y8l1eWjl.png]

* Sorry to place an image. For some reason if I write the text here the forum doesn't let me make the post.

I restarted my computer but when I connect/disconnect the external mouse the udev rules don't work. The system recognize the mouse and it works ok. But it appears that the udev rules are not "charged".
What I am doing wrong?
Reply


Messages In This Thread
How to enable/disable the touchpad when connecting an external mouse? - by estelondono - 04-11-2017, 03:40 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)