SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My laptop has a touchpad and there's no way to switch the trackpad on and off via the hardware.
So to avoid random, possibly destructive palm-swipes, I set up xorg.conf so that the trackpad was off when my usb mouse was present. In slackware 11 I achieved this with:
and pointing the /dev/mouse symlink to /dev/input/mouse0, which was the USB mouse, if connected, or, if not, the trackpad. Hence no need to ever edit xorg.conf. Lovely
In slackware 12.1 this no longer works as the trackpad is always mouse1 and usb mouse is always mouse2. mouse0 isn't anything (there's no ps2 socket?). I can see why this makes sense - perhaps my slack 11 method was a bit of kludge really.
So at present I've got to remember to edit xorg.conf or use layouts depending whether my USB mouse is connected or not. Is there a better way that would get me back to what I had in slack 11?
udev is a way of managing linux devices accessed via /dev filesystem. it incorporates rules and simple progmatic decision making to create /dev/xxx files. you can use this to create /dev files that are different depending on whether your mouse is connected or not, and its all automatic once you have set it up. no editing thereafter!
simply create a udev rule (/etc/udev/rules.d) to setup the symlinks in the /dev dir when you mouse is connected (or not).
Just hit an annoyance: if I start my laptop up from scratch with the usb mouse plugged in then the trackpad still works. I have to either do synclient TouchpadOff=1 manually or unplug and plug the mouse.
so far as booting with mouse plugged in, I think you need to change the way you run your rule. ADD/REMOVE is an event, I am not convinced these events are triggered unless a change of state occurs. i.e. if you boot up with a device, the event is only triggered once you remove a device, or plug it in. this behavior is what you are seeing.
rather than ADD/REMOVE try some logic like ...
<enable the touchpad by default at system start>
<IF mouse device loaded THEN>
<disable touchpad>
<ENDIF>
there are many ways to start touchpad at system start, if not already done so.
it is possible to use the following to disable touchpad if a mouse driver is loaded
note that mouse0 may be different on your system. to confirm if mouse0 is your interface to the mouse, then try
# udevinfo -a -p /sys/class/input/mouse0
udev and the kernel communicate via something called 'sysfs' or /sys to you+me. All devices managed by udev can be interrogated by using appropriate interfaces under /sys
so, you should get something like
looking at device '/class/input/input0/mouse0':
KERNEL=="mouse0"
SUBSYSTEM=="input"
DRIVER==""
ATTR{dev}=="13:32"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.