If you've just installed Gentoo, you almost certainly don't have your mouse set
up to work within a command line interface (CLI) yet. Or perhaps you can't use
or don't need an X server, yet you still need to use a mouse. The solution is
simple:
First, you will need to get GPM:
# emerge gpm
You might have noticed a few messages during the compilation that warned about configuring the server. You must do this before starting GPM.
Before you can use GPM, you will need to uncomment the lines corresponding to the location and protocol of your mouse. You do this by editing the GPM configuration file:
# nano /etc/conf.d/gpm
In my case, I have a USB mouse on
(Please uncomment the type of mouse you have and the appropriate MOUSEDEV entry) #MOUSE=ps2 MOUSE=imps2 #MOUSEDEV=/dev/psaux MOUSEDEV=/dev/input/mice
If you have a wheelmouse, you will want to use the imps2 protocol, so uncomment
that line. If imps2 and ps2 both fail to work for you, please refer to the GPM
info page (
(Please uncomment this line if you want GPM to understand charsets used in URLs and names with ~ or : in them, etc. This is a good idea to turn on!) APPEND="-l \"a-zA-Z0-9_.:~/\300-\326\330-\366\370-\377\""
The rest of the conf.d file contains other suggestions for your mouse server;
uncomment the various options according to your needs. See
Now that your mouse server is installed and configured, it's time to start using it:
# /etc/init.d/gpm start
You should see a block cursor appear. Remember that only root can run the GPM
init script. However, to avoid having to
# rc-update add gpm default
Now, whenever you start your computer, you'll be greeted by the console cursor by the time you get to the login prompt. The mouse server will continue to run even if you're not logged in as root.
Copying and pasting large blocks of text with a working mouse server is very
easy. Simply highlight the text with the left mouse button (it will stay
highlighted when you release the button), switch to a different terminal if you
wish, position the cursor, and press the middle mouse button to paste the text
where you placed the cursor. Note that you can copy and paste without ever
leaving the terminal you started. This makes posting the output of error
messages to the
If you have a message on one screen and a text-mode web browser on the other, you can copy the error message by highlighting it, then change to the other terminal, left-click the appropriate text entry box to select it, and then press the middle mouse button. VoilĂ ! Your error message can now be posted to the forums.
Though discussion of text-only browsers is somewhat beyond the scope of this
guide, inevitably users will need to find a compatible console browser. Though
# emerge links
This concludes the guide to using a mouse within the console. Happy mousing!