LinuxCommandLibrary

viewres

Display X server resource database contents

SYNOPSIS

viewres [-style|-geometry] [-metric|-spec] [program [server]]

PARAMETERS

-style
    Display resources in style format (colors, fonts, etc.). Default when unspecified.

-geometry
    Display only geometry-related resources (width, height, positions).

-metric
    Use metric units (pixels, points) for dimensions. Default.

-spec
    Use specification units (e.g., '50%', '*2').

program
    Application name (e.g., xterm). Omitting shows all clients.

server
    Optional X server (display name or transport). Defaults to $DISPLAY.

DESCRIPTION

The viewres command is a utility from the X11 toolkit that examines and displays the X resources (properties) used by Xt-based applications. It retrieves resource values such as colors, fonts, and geometry settings from the X server's property database.

Typically, applications store their resource properties under the name XMResourceList or similar on the root window or application window. viewres lists these in a human-readable format, helping developers and users inspect effective resource values without parsing xrdb databases manually.

By specifying an application name (e.g., xterm), it shows resources like *foreground, *background, *font. Outputs can be formatted as style properties, geometry specs, or in metric/specifier units. Useful for debugging resource overrides, class-specific settings, and fallback values in X11 environments.

CAVEATS

Requires running X11 session; only shows properties set by Xt apps via XtGetApplicationResources(); no effect on non-Xt programs; output is read-only, use editres(1) for editing.

EXAMPLE USAGE

viewres xterm
Shows xterm's style resources in metric units.

viewres -geometry -spec xclock :1
Geometry specs for xclock on display :1.

HISTORY

Part of X Toolkit Intrinsics (Xt) utilities since X11R1 (1987); maintained in xorg-x11-utils; largely unchanged, used in legacy X11 debugging.

SEE ALSO

appres(1), editres(1), xrdb(1), xprop(1), xwininfo(1)

Copied to clipboard