LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Select mouse at boot time (https://www.linuxquestions.org/questions/slackware-14/select-mouse-at-boot-time-424426/)

l0rddarkf0rce 03-13-2006 11:02 AM

Select mouse at boot time
 
I'm running Slack 10.2 on a laptop and I would like to configure the mouse at boot time. If I have my usb mouse connected run gpm with the '-t imps2' option otherwise run it with the '-t ps2' option. Is there any way to check if the usb mouse is connected?

TIA for any help!

Alien_Hominid 03-13-2006 11:35 AM

Don't know,maybe the option auto will work for both.

l0rddarkf0rce 03-13-2006 12:22 PM

nope it did not work

piete 03-13-2006 12:29 PM

Yep, this should be very possible (I might have to try it on my laptop, it looks good!).

Reading the gpm man page here: http://www.die.net/doc/linux/man/man8/gpm.8.html

Indicates a -M option that will read multiple devices. Presumably, if your usb isn't plugged in, it'll just ignore it) but if it is, it'll work fine - you will need to test this.

The script you need to edit to make this work is: /etc/rc.d/rc.gpm

You may wish to back it up first, and don't forget you can always stop/start/restart it without rebooting by using the following options:

Code:

/etc/rc.d/rc.gpm stop
/etc/rc.d/rc.gpm start
/etc/rc.d/rc.gpm restart

Let us know how you get on!

- Piete.

l0rddarkf0rce 03-13-2006 01:38 PM

now based on this how do I redirect /dev/mouse to the appropriate device /dev/psaux or /dev/input/mice? my xorg.conf is pointing to /dev/mouse and if the link is not pointing to a working device it complains and dies.

pdw_hu 03-13-2006 04:07 PM

rm /dev/mouse
ln -s /dev/whateveryouneed /dev/mouse

ln -s = to create symbolic links

piete 03-13-2006 04:36 PM

In Xorg you can set both devices to run at once without using gpm at all if you set the builtin point to "AlwaysCore" and the USB to "SendCoreEvents".

Check here (http://www.die.net/doc/linux/man/man5/xorg.conf.5.html) for the man page of xorg.conf and here (http://www.kaear.co.uk/linux/xconf/XF86Config.laptop) for my laptop's current xorg.conf file.

l0rddarkf0rce 03-15-2006 05:56 PM

Quote:

Originally Posted by piete
In Xorg you can set both devices to run at once without using gpm at all if you set the builtin point to "AlwaysCore" and the USB to "SendCoreEvents".

Check here (http://www.die.net/doc/linux/man/man5/xorg.conf.5.html) for the man page of xorg.conf and here (http://www.kaear.co.uk/linux/xconf/XF86Config.laptop) for my laptop's current xorg.conf file.

Not working, but thanks for the suggestion... X will pick whichever device is marked as Mouse0 (even if it is not present). If I make /dev/psaux my Mouse0 then it never even tries to get to /dev/input/mice. Here is the mouse definitions from my /etc/X11/xorg.conf

Code:

Section "InputDevice
Identifier        "Mouse1"
Option                "ZAxisMapping" "4 5"
Driver                "mouse"
Option                "Protocol" "imps/2"
Option                "Device"  "/dev/input/mice"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
EndSection

All I want is that X picks a mouse when I boot and not crash when I boot the machine. For example...

Use my USB mouse if it is plugged (usually @ home or the office)
Use the glide mouse on the laptop when an USB mouse is not connected (in planes, etc)

piete 03-16-2006 02:52 AM

Ok, I think you're Xorg.conf is probably incorrect if it's not working.

First of all, we're not writing Xorg.conf to "choose" a mouse, merely telling it to use more than one mouse. If I don't have my usb plugged in when I startx, it just gets ignored. If my usb *is* plugged in, then not only can I use my usb mouse, but also my trackpoint.

The steps to get this working are as follows:

1. Find your USB mouse device (/dev/input/mice ?) - cat /dev/input/mice and wiggle the device about to check it's correct.
2. Do the same with your touchpad (/dev/psaux ?)
3. Add both devices as separate inputdevices in your xorg.conf file (as above)
4. Edit your ServerLayout section to look similar to:

Code:

Section "ServerLayout"
Identifier    "MyLayout"
Screen      0  "Screen0" 0 0

InputDevice        "Mouse0" "CorePointer" # <-- This is the touchpad that should always be used
InputDevice        "Mouse1" "SendCoreEvents"  # <-- This will get used if it's around, but, doesn't matter if it's not!

InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

If this still doesn't work you will have to post your entire Xorg.conf file to see what's missed.

Panagiotis_IOA 03-16-2006 07:35 AM

I changed my xorg.conf on InputDevice Section and ServerLayout and now KDE doesn't start. It gets stack on "Starting X11 session...". The problem is that I have runlevel 4 so KDE starts automatically and now I have no idea how I could get to shell to change from there my xorg.conf. Any suggestions?

piete 03-16-2006 08:06 AM

If you boot into runlevel 3 while testing this stuff it's easy to fix if it doesn't work =)

However, since you're booting into 4, ctrl + alt + F6 will get you a standard login prompt. Login as root and type: init 3
This'll put you in runlevel 3 where you can use joe/jed/vi/vim/pico/nano (delete as appropriate) to edit xorg.conf.

When you've tweaked it a bit, run startx from some other TTY (as user, not root) and note the output of startx, it'll tell you what the problem is exactly (ok, it might be obfuscated a bit). The error messages will help us track down the issue.

- Piete.

Panagiotis_IOA 03-16-2006 09:08 AM

Well, I was looking at the output of error messages and there were some incorrect typings among the lines in xorg.conf like "End Section" instead of "EndSection". I edited to the original form and X started. Then I tried again to configure it, so my touchpad will be working and I had to change at the ServerLayout "Screen0" to "Screen1" and "Keyboard0" to "Keyboard1". Now everything works fine!:)

piete 03-16-2006 09:42 AM

w00h00! *does the fixx0red groove*

Ooh yeah, ooh yeah ... *dances*

I'm glad it works for you, hope you learnt a lot ;)

- Piete.

l0rddarkf0rce 03-16-2006 02:58 PM

Quote:

Originally Posted by piete
Ok, I think you're Xorg.conf is probably incorrect if it's not working.

First of all, we're not writing Xorg.conf to "choose" a mouse, merely telling it to use more than one mouse. If I don't have my usb plugged in when I startx, it just gets ignored. If my usb *is* plugged in, then not only can I use my usb mouse, but also my trackpoint.

The steps to get this working are as follows:

1. Find your USB mouse device (/dev/input/mice ?) - cat /dev/input/mice and wiggle the device about to check it's correct.
2. Do the same with your touchpad (/dev/psaux ?)
3. Add both devices as separate inputdevices in your xorg.conf file (as above)
4. Edit your ServerLayout section to look similar to:

Code:

Section "ServerLayout"
Identifier    "MyLayout"
Screen      0  "Screen0" 0 0

InputDevice        "Mouse0" "CorePointer" # <-- This is the touchpad that should always be used
InputDevice        "Mouse1" "SendCoreEvents"  # <-- This will get used if it's around, but, doesn't matter if it's not!

InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

If this still doesn't work you will have to post your entire Xorg.conf file to see what's missed.


Dude a million thanks for your help and pacience! It works like a charm. :D


All times are GMT -5. The time now is 05:41 AM.