Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Laptop mouse and external mouse, X configuration< Next Oldest | Next Newest >
ddawson377 Offline





Group: Members
Posts: 1
Joined: Dec. 2005
Posted: Dec. 11 2005,06:58 QUOTE

Hello,

I have looked on the forums and some on the wiki, but I was unable to find an answer to this question.  I am familiar with Xfree86, but not Xvesa.

I am running DSL on an old pentium laptop, and have DSL installed to the hard drive.  It is ruuning quite nicely w/Xvesa, but I would like to be able to switch between the built in mouse (/dev/psaux) and an external USB mouse (/dev/input/mouse).

I can think of several approaches, but don't know how to implement them:
1) add case statements to xinitrc or xservrrc that identify if the USB mouse is plugged in and alter the Xvesa line

2)Add a script that asks the user what mouse to use before the X session.  I want to avoid having to go thru the entire xsetup.sh script each time.  I tried putting this in xservrrc, but the X session began without waiting for the input response.

3)Putt both mice in Xvesa line (syntax?), or cat one device into the other so both run at once.  Not sure if this would work.

What the heck is starting X anyway? I don't see the rcX.d method working here, nor is there a .login that I can see.

Please let me know if any of you have thoughts or suggestions.

Thanks in advance,
Douglas
Back to top
Profile PM 
ddawson377
Unregistered






Posted: Dec. 13 2005,01:51 QUOTE

Here's how I worked around this problem.  I couldn't figure a way to autodetect, so I wrote a small script that asks the user if they have an external USB mouse.  First I used the xsetup.sh script to configure for the onboard trackball (/dev/psaux) and copied the .xserverrc to .xserverrc-ps2-mouse.  Then I used  xsetup.sh to configure for the USB mouse and copied that to .xserverrc-usb-mouse.

Then I copied .bash_profile to .bash_profile_backup and edited .bash_profile as follows:
From :
--------------------------------------------------
#!/bin/bash
export IRCNICK=DSL
SSH=`env | grep SSH_CONNECTION`
if [ -z "$SSH" ]; then startx; fi
---------------------------------------------------
To:
----------------------------------------------------
#!/bin/bash
export IRCNICK=DSL
SSH=`env | grep SSH_CONNECTION`
if [ -z "$SSH" ]; then ~/.which_mouse.sh; fi
---------------------------------------------------

Then I created the following file .which_mouse.sh file:
--------------------------------------------------------
#!/bin/bash
echo -e  "\n"
echo -e  "Are you using a USB mouse [y/n]? \c"
read
echo -e  "\n"

case $REPLY  in
y)  
 cp ~/.xserverrc-usb-mouse ~/.xserverrc
 ;;
n)  
 cp ~/.xserverrc-ps2-mouse ~/.xserverrc
 ;;
*)  
 cp ~/.xserverrc-ps2-mouse ~/.xserverrc
 ;;
esac


exec startx
--------------------------------------------------------------

That's it.  Now when you sign in you get asked which kind of mouse you want.  Not automagic, but not as many buttoon pushes as running xsetup.sh everytime.  Modular coponents as well, so orginal intent of system designer is altered as little as possible.

Please feel free to comment if you see an error, hole, or area for improvement.
Douglas
Back to top
1 replies since Dec. 11 2005,06:58 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: Laptop mouse and external mouse

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code