04-11-2017, 03:40 PM
(This post was last modified: 04-20-2017, 08:39 PM by estelondono.)
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
and the script to enable it
I made the rule in /etc/udev/rules.d/10-personal.rules:
* 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?
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:
* 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?