xm - quickly & interactively magnify/zoom part of the
screen
xm [ -d)isplay DP ] [ -n)et ] [ -f)ont FN ] [
--fontH PX ] [ -x)mag PX ] [ -y)mag PX ] [ -o)utG
XGEOM ] [ -i)nG XGEOM ] [ -u)nshifted PX ] [ -s)hifted
PX ] [ --gHS PX ] [ --gHO PX ] [ --gVS PX ] [
--gVO PX ] [ -b)ox ] [ -B)Width PX ] [ -b)Color INT ] [
-c)hase ] [ -t)ime MILLISEC ] [ -w)atch PATH ] [ -h ]
- -d)isplay
DISPLAY
- X display to use.
- -n)et
- Force network transparent graphics, not X11 shm. Default: off
- -f)ont
X11_FONT
- Set font used for on-screen help. Default: none
- --fontH
PIXELS
- Set height/spacing for on-screen help font. Default:
0|fontHeight
- -x)mag
PIXELS
- How many x pixels in magnified output for each 1 in input area.
- -y)mag
PIXELS
- How many y pixels in magnified output for each 1 in input area.
- -o)utG
X11_GEOMETRY
- XParseGeometry size & position of OUT window. Default:
WM Placed
- -i)nG
X11_GEOMETRY
- XParseGeometry size & position of initial IN area.
Dimensions are multiplied by mags to set OUT geometry.
Default: 256 256
- -u)nshifted
PIXELS
- Step size in pixels for unshifted arrow key motion. Default: 8
- -s)hifted
UNSHIFTED
- Step size in pixels for shifted arrow key motion. Default: 1
- --gHS
PIXELS
- grid Horizontal line Spacing in pixels. Default:
30
- --gHO
PIXELS
- grid Horizontal line Offset in pixels. Default:
30
- --gVS
PIXELS
- grid Vertical line Spacing in pixels. Default:
30
- --gVO
PIXELS
- grid Vertical line Offset in pixels. Default:
30
- -b)ox
- Toggle drawing bounding box around zoomed area. Default: on
- -B)Width
- Set width in pixels of the edges of the bounding box. Default:
4
- -BC)olor
- Set color as a decimal version of an 0xRRGGBB color. Default: 55
NOTE: bash&zsh let you convert to decimal with, e.g.
$((16#B800B8)) which produces "MAG)enta".
- -c)hase
- Toggle chasing pointer to define the zoomed area. Default: on
- -t)ime
MICROSEC
- Time to sleep between image captures. Default: 40_000 (~25 FPS).
0 means sample & repaint as fast as possible.
- -w)watch
PATH
- Monitor st_mtime of file PATH. If it changes, print
configuration & toggle pointer chasing. This is useful if focus
follows pointers to chase to a specific area, and then display/freeze it
by invoking a WM action that updates WATCH.
- -h|--help
- Print a brief help message for the CLI.
${XM_CONFIG:-${XDG_CONFIG_HOME:-$HOME/.config}}/xm can set
pre-command-line values for all above using full length option keys in Nim
parsecfg syntax (~INI-file).
xm displays in its window a magnified area of the X11
display (which can include the magnified area itself). Users can
interactively change various things as described below.
Once xm is running, users can enter keyboard commands:
- x/y
- NEXT +, -, g applies to only this axis, not both axes
- s
- NEXT +, - applies to larger of the two step sizes for arrows
- +/-
- increase / decrease selected value by 1
- g
- toggle Grid on & off -- sort of. Rather than a simple toggle, the
action is align = scale - align. So, if alignment is never changed
from 0, it is a toggle. Axis-specific g re-zeros alignment. E.g.
x g y g g resets both aligns & then turns off the grid.
- Arrow Keys
- Operate By Shifted/Unshifted Step Sizes. Mnemonically, Ctrl
is about SIZES while Alt is about the GRID.
- NoModifier
- Pan zoomed area in direction of arrow
- OnlyCtrl
- Resize zoom view window by direction of arrow
- Ctrl-Alt
- Change spacing of xy-grid lines to move grid corners in direction of arrow
(<-: -, ->: +)
- OnlyAlt
- Change alignment of xy-grid lines to move grid corners in direction of
arrow (<-: -, ->: +)
- b
- toggle Box on & off
- c
- toggle pointer Chase on & off
- p
- Print a current configuration replicating relaunch command
- h
- toggle Help xor-overlay (activated by any illegal key)
- q
- Quit, printing frames processed
xmag(1x) xzoom(1x) XParseGeometry(3)
† xm is given with no warranty but works for me.
† This complements xmag which has a very different
"snapshot" usage.
† Pointer chasing can compete with both Window Manager (WM)
resize ops and xm keyboard panning controls. Just disable chase as
needed.
Itai Nahshon <nahshon@best.com> originally wrote
xzoom in the mid-1990s. github.com/mbarakatt added pointer tracking
to a heavily patched Debian variant. In 2025, Charles Blake rewrote the
ideas into Nim xm, dropping rotation & title changes &
extending CLI/UI, adding/re-thinking much, such as bounding box draws,
chase/box/shm as run-time states, WM interactions, near screen edge
behavior, kb-based resize/grid spec/edit/step size, help text overlay, watch
files, cfg print, hash-based frame-write skips for >10x speed-up, etc.,
etc.