xmag
Magnify a portion of the X display
SYNOPSIS
xmag [ -display host:display ] [ -geometry geom ] [ -source geom ] [ -mag factor ] [ -fn font ] [ -bd color ] [ -bw pixels ] [ -fg color ] [ -bg color ] [ -name name ] [ -title title ] [ -rv ] [ -xrm resource_string ] [ -version ]
PARAMETERS
-display host:display
Specifies the X server to connect to, overriding the DISPLAY environment variable.
-geometry geom
Specifies the preferred size and position of the magnifier window. This is the window that displays the magnified view.
-source geom
Specifies the geometry of the source region to be magnified. This allows predefining the area without interactive selection, using a standard X geometry string (e.g., 100x100+50+50).
-mag factor
Sets the magnification factor. The default value is 5. For example, -mag 2 will show pixels twice their original size.
-fn fontname
Specifies the font to be used for displaying coordinate information within the magnifier window.
-bd color
Sets the border color of the magnifier window.
-bw pixels
Sets the border width of the magnifier window in pixels.
-fg color
Sets the foreground color, primarily used for text (e.g., coordinates) within the magnifier window.
-bg color
Sets the background color of the magnifier window.
-name name
Sets the application name, which can be used by window managers or for X resource lookups.
-title title
Sets the title of the magnifier window, which appears in the window manager's title bar.
-rv
Reverses the foreground and background colors of the magnifier window.
-xrm resource_string
Allows setting arbitrary X resources directly on the command line. For example, xmag -xrm 'xmag.magnification: 10'.
-version
Prints the version information of the xmag utility to standard output and exits.
DESCRIPTION
xmag is a utility for the X Window System that provides a magnified view of a selected area of the screen.
When launched, the cursor typically changes to a crosshair. The user can then click and drag to define a rectangular region on the screen. Upon releasing the mouse button, xmag opens a new window displaying a magnified version of the content within the selected rectangle. This tool is particularly useful for examining fine details, verifying pixel-level accuracy, or assisting users with visual impairments by enlarging small text or graphics.
The magnification factor can be adjusted, offering flexibility in how much an area is enlarged. It's a simple yet effective tool for visual inspection in a graphical environment, primarily interacting directly with the X server.
CAVEATS
xmag is a relatively old utility and relies directly on the X Window System. It may not integrate seamlessly or function correctly in modern display servers like Wayland, or in desktop environments that heavily rely on compositors that interfere with direct screen pixel access.
Performance can vary depending on system resources and the size of the magnified area; very large areas or high magnification factors might introduce noticeable lag. The magnified view is a snapshot that updates, but not necessarily in real-time, which can lead to tearing or slight delays with rapidly changing screen content.
USAGE INTERACTION
When xmag starts without a -source option, the cursor typically changes to a crosshair. The user then clicks and drags a rectangle on the screen to define the area of interest. Releasing the mouse button opens a new window showing the magnified content of the selected area. To re-select an area, simply repeat the click-and-drag action. The magnifier window can be resized, but this only changes the window's display area, not the magnification factor itself, which is controlled by the -mag option or X resources.
X RESOURCES
xmag supports X resources for persistent configuration. Users can set default values for its options (e.g., magnification factor: xmag.magnification, border color: xmag.borderColor, font: xmag.font) in their X resource files (e.g., ~/.Xresources or ~/.Xdefaults). These settings will then apply automatically when xmag is launched without explicit command-line options, providing a convenient way to customize its default behavior.
MODERN ALTERNATIVES
For users on modern desktop environments like GNOME or KDE, more integrated and feature-rich screen magnifiers are often available. Examples include GNOME Magnifier (part of the Orca accessibility suite) or KMagnifier. These tools typically offer smoother scrolling, dynamic magnification, and better integration with accessibility features and Wayland-based systems, addressing limitations inherent in older X-specific utilities like xmag.
HISTORY
xmag has been a staple tool within the X Window System environment since its early development. It is part of the x11-apps or xorg-apps package, which bundles many standard X utilities designed to provide basic functionalities. Its design philosophy aligns with the Unix tradition of simple, effective tools that 'do one thing and do it well.' While more sophisticated screen magnifiers exist today within modern desktop environments (e.g., GNOME Magnifier, KMagnifier), xmag remains available for its simplicity and direct interaction with the X server, making it useful in minimal X installations or for developers needing to debug display issues at a pixel level.