Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Let The Music Play: Join EFF Today

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 70 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here




       gpm [ options ]


       This package tries to be a useful mouse server for  appli­
       cations  running on the Linux console.  It is based on the
       "selection" package, and  some  of  its  code  comes  from
       selection  itself.  This package is intended as a replace­
       ment for "selection" as a cut-and-paste mechanism; it also
       provides  additional  facilities.  The "selection" package
       offered the first cut-and-paste implementation  for  Linux
       using  two  mouse  buttons,  and  the  cut buffer is still
       called "selection buffer" or just  "selection"  throughout
       this  document.   The  information below is extracted from
       the texinfo file, which is the preferred source of  infor­

       The  gpm  executable  is meant to act like a daemon (thus,
       gpmd would be a better name for it). This section is meant
       to  describe  the  command-line options for gpm, while its
       internals are outlined in the next section.

       Due to restrictions in the ioctl(TIOCLINUX)  system  call,
       gpm  must  be  run by the superuser. The restrictions have
       been added in the last 1.1 kernels to fix a security  hole
       related to selection and screen dumping.

       The  server  can  be configured to match the user's taste,
       and any application  using  the  mouse  will  inherit  the
       server's  attitude.  From release 1.02 up to 1.19.2 is was
       possible for any user logged  on  the  system  console  to
       change  the  mouse feeling using the -q option. This is no
       longer possible for security reasons.

       As of 0.97 the server program puts  itself  in  the  back­
       ground.  To  kill gpm you can just reinvoke it with the -k
       cmdline switch, although  killall  gpm  can  be  a  better


       Version  1.10  adds the capability to execute special com­
       mands on certain circumstances. Special  commands  default
       to  rebooting  and  halting  the  system, but the user can
       specify his/her personal choice. The capability to  invoke
       commands  using  the mouse is a handy one for programmers,

       The default special commands are:

       left button
              Reboot the system by signalling the init process

       middle button (if any)
              Execute /sbin/shutdown -h now

       right button
              Execute /sbin/shutdown -r now

       The -S command line switch enables  special  command  pro­
       cessing  and  allows to change the three special commands.
       To accept the default commands use -S "" (i.e., specify an
       empty  argument).   To  specify  your  own commands, use a
       colon-separated list to specify commands associated to the
       left,  middle  and right button. If any of the commands is
       empty, it is interpreted as `send a  signal  to  the  init
       process'. This particular operation is supported, in addi­
       tion to executing external commands, because sometimes bad
       bugs put the system to the impossibility to fork; in these
       rare case the programmer should be able  to  shutdown  the
       system anyways, and killing init from a running process is
       the only way to do it.

       As an  example,  -S  ":telinit  1:/sbin/halt",  associates
       killing  init to the left button, going single user to the
       middle one, and halting the system to the right button.

       System administrators should obviously  be  careful  about
       special  commands, as gpm runs with superuser permissions.
       Special commands are best suited for computers whose mouse
       can be physically accessed only by trusted people.


       Available command line options are the following:

       -a accel
              Set  the  acceleration  value  used  when  a single
              motion event is longer than delta (see -d).

              Start up with selection pasting disabled.  This  is
              intended  as a security measure; a plausible attack
              on a system seems to be to stuff a nasty shell com­

       case $( /usr/bin/tty ) in
       /dev/tty[0-9]*) /usr/bin/disable-paste ;;

       -b baud
              Set the baud rate.

       -B sequence
              Set  the  button  sequence.  123  is   the   normal
              sequence,  321  can  be used by left-handed people,
              and 132 can be useful with two-button  mice  (espe­
              cially  within  Emacs). All the button permutations
              are allowable.

       -d delta
              Set the delta value. When a single motion event  is
              longer  than  delta, accel is used as a multiplying
              factor. (Must be 2 or above)

       -D     Do not  automatically  enter  background  operation
              when  started,  and  log  messages  to the standard
              error stream, not the syslog  mechanism.   This  is
              useful  for  debugging; in previous releases it was
              done with a compile-time option.

       -g number
              With glidepoint devices, emulate the specified but­
              ton  with  tapping.  number must be 1, 2, or 3, and
              refers to the button number before  the  -B  button
              remapping is performed.  This option applies to the
              mman and ps2 decoding. No  button  is  emulated  by
              default  because  the  ps2  tapping is incompatible
              with some normal ps2 mice

       -h     Print a summary of command line options.

       -i interval
              Set interval to be used as an upper time limit  for
              multiple  clicks. If the interval between button-up
              and button-down events  is  less  than  limit,  the
              press  is considered a double or triple click. Time
              is in milliseconds.

       -k     Kill a running gpm. This can be  used  by  busmouse
              users to kill gpm before running X (unless they use
              -R or the single-open limitation  is  removed  from
              the kernel).

       -l charset
              Choose  the  inword()  look  up  table. The charset
              option  will  be  used  for  the first device. This
              option  automatically  forces  the  repeater   (-R)
              option on.

       -o list-of-extra-options
              The  option  works similary to the ``-o'' option of
              mount; it is used to  specify  a  list  of  ``extra
              options'' that are specific to each mouse type. The
              list is comma-separated. The options  dtr,  rts  or
              both  are used by the serial initialization to tog­
              gle the modem lines like, compatibly  with  earlier
              gpm  versions; note however that using -o dtr asso­
              ciated with non-plain-serial mouse  types  may  now
              generate an error.  And by the way, use -o after -m
              and after -t.

       -p     Forces the pointer to be visible  while  selecting.
              This  is  the behaviour of selection-1.7, but it is
              sometimes confusing.  The default is  not  to  show
              the pointer, which can be confusing as well.

       -r number
              Set  the responsiveness. A higher responsiveness is
              used for a faster cursor motion.

              Causes gpm to act as a  repeater:  any  mouse  data
              received  while in graphic mode will be produced on
              the fifo /dev/gpmdata in protocol name, given as an
              optional  argument  (no  space  in  between !).  In
              principle, you can use the same names as for the -t
              option,  although repeating into some protocols may
              not be implemented for a while.  In  addition,  you
              can  specify  raw  as the name, to repeat the mouse
              data byte by byte, without  any  protocol  transla­
              tion.   If  name  is  omitted,  it defaults to msc.
              Using gpm in repeater mode, you can configure the X
              server  to  use  its  fifo  as a mouse device. This
              option is useful for bus-mouse owners  to  override
              the  single-open limitation. It is also an easy way
              to manage those stupid dual-mode mice  which  force
              you  to  keep the middle button down while changing
              video mode. The option  is  forced  on  by  the  -M

       -s number
              Set the sample rate for the mouse device.

       -S commands
              Enable  special-command  processing, and optionally
              specify custom commands as a colon-separated  list.

       -V[verbosity increment]
              Raise  or  decrease  the  maximum level of messages
              that will be logged.  Thus a positive argument  has
              the effect of making the program more verbose.  One
              can also give a negative argument to hush the  pro­
              gram; due to getopt(3) rules, any optional argument
              needs to be passed  without  a  space  in  between!
              When  omitting the argument, the increment defaults
              to 1.  Default verbosity level is 5 (LOG_NOTICE).

       -2     Force two buttons. This means that the middle  but­
              ton, if any, will be taken as it was the right one.

       -3     Force three buttons. By default the mouse  is  con­
              sidered  to  be  a  2-buttons one, until the middle
              button is pressed. If three buttons are there,  the
              right  one is used to extend the selection, and the
              middle one is used to paste it.  Beware: if you use
              the  -3 option with a 2-buttons mouse, you won't be
              able to paste the selection.


       To select text press the left mouse button  and  drag  the
       mouse.   To  paste  text  in  the same or another console,
       press the middle button.  The  right  button  is  used  to
       extend the selection, like in `xterm'.

       Two-button mice use the right button to paste text.

       Double  and  triple  clicks  select  whole  word and whole
       lines. Use of the `-p'  option  is  recommended  for  best
       visual feedback.

       If  a trailing space after the contents of a line is high­
       lighted, and if there is no other text on the remainder of
       the  line, the rest of the line will be selected automati­
       cally. If a number  of  lines  are  selected,  highlighted
       trailing  spaces  on  each  line  will be removed from the
       selection buffer.

       Any output on the virtual console  holding  the  selection
       will  clear  the highlighted selection from the screen, to
       maintain integrity of the display, although  the  contents
       of the paste buffer will be unaffected.

       Two instances of gpm can't run on the same system. If  you
       have two mice use the -M option (see above).

       While  the  current console is in graphic mode, gpm sleeps
       until text mode is back (unless  -R  is  used).  Thus,  it
       won't  reply  to  clients.  Anyways,  it  is unlikely that
       mouse-eager clients will spur out in hidden consoles.

       The clients shipped out with gpm  are  not  updated,  thus
       there are potential security risks when using them.


       Andrew Haylett <ajh@gec-mrc.co.uk> (the original selection code)
       Ian Zimmerman <itz@speakeasy.org> (old maintainer)
       Alessandro Rubini <rubini@linux.it> (old maintainer (still helps a lot))
       Nico Schottelius <nico@schottelius.org> (maintainer)

       Many many contributors, to both selection and gpm.


       The  current  maintainer  is Nico Schottelius. But without
       the help of Alessandro Rubini  and  the  mailing  list  it
       would  be impossible for him to maintain gpm. The develop­
       ment mailing list can be reached under gpm@lists.linux.it.
       More information on the list is in the README file part of
       the source distribution of gpm.


       /var/run/gpm.pid The PID of the running gpm
       /dev/gpmctl     A control socket for clients
       /dev/gpmdata    The fifo written to by a repeater (`-R') daemon.


        mev(1)        A sample client for the gpm daemon.
        gpm-root(1)   An handler for Control-Mouse events.

       The info file  about  `gpm',  which  gives  more  complete
       information and explains how to write a gpm client.


There are several different ways to navigate the tutorial.



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
You can choose larger fonts by selecting a different themes.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.09 Seconds