LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

gpm

Console mouse support daemon

TLDR

Start gpm with a PS/2 mouse
$ sudo gpm -m /dev/input/mice -t ps2
copy
Start gpm with a Microsoft serial mouse
$ sudo gpm -m /dev/ttyS0 -t ms
copy
Start gpm in the foreground for debugging
$ sudo gpm -m [path/to/mouse_device] -t [mouse_type] -D
copy
Kill the running gpm
$ sudo gpm -k
copy
Start gpm in repeater mode for X server compatibility
$ sudo gpm -m [path/to/mouse_device] -t [mouse_type] -R
copy
List the available mouse types
$ gpm -t help
copy

SYNOPSIS

gpm [options]

DESCRIPTION

gpm (General Purpose Mouse) provides mouse support for the Linux virtual console (text mode). It enables copy/paste functionality, mouse cursor movement, and mouse button events in console applications.Text selection is done by holding the left button and dragging. Middle button pastes selected text. Right button extends selection. This provides clipboard functionality similar to X11 in pure text mode.In repeater mode (-R), gpm can pass mouse events to X server, allowing both console and X applications to share the mouse device.

PARAMETERS

-m DEVICE

Mouse device (e.g., /dev/input/mice, /dev/ttyS0)
-t TYPE
Mouse type (ps2, ms, imps2, etc.)
-R [TYPE]
Repeater mode for X server; optionally specify output type
-D
Debug mode; run in foreground
-k
Kill running gpm daemon
-B SEQUENCE
Button sequence (1, 2, 3 or permutation)
-2
Force two-button mouse emulation
-3
Force three-button mouse emulation

CONFIGURATION

/etc/gpm.conf

Daemon configuration including mouse device, type, and options.

INSTALL

sudo apt install gpm
copy
sudo dnf install gpm
copy
sudo pacman -S gpm
copy
sudo apk add gpm
copy
sudo zypper install gpm
copy
nix profile install nixpkgs#gpm
copy

CAVEATS

Only works in Linux virtual consoles, not terminal emulators or SSH sessions. Requires root privileges. May conflict with X server mouse handling if not configured for repeater mode. Modern systems often use systemd to manage gpm.

HISTORY

gpm was created by Alessandro Rubini in 1994 to bring mouse support to the Linux console. It became essential for text-mode applications and system administration before graphical desktops became prevalent. The project remains maintained for console-based systems.

SEE ALSO

Xorg(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid