LinuxCommandLibrary

xsetroot

Change the root window appearance

SYNOPSIS

xsetroot [-display display] [-help] [-def] [-name string] [-cursor cursorfile cursorfile] [-bitmap filename] [-mod x y] [-fg color] [-bg color] [-rv] [-solid color]

PARAMETERS

-display display
    Specifies the X server to connect to.

-help
    Prints a summary of the command line options.

-def
    Resets the root window to the default background.

-name string
    Sets the name of the root window.

-cursor cursorfile cursorfile
    Sets the root window cursor to the specified cursor files. The files should be in X11 cursor format.

-bitmap filename
    Sets the root window background to the specified bitmap file. Use 'none' for no bitmap.

-mod x y
    Creates a modular background pattern with specified x and y densities. Accepts values from 1 to 16.

-fg color
    Sets the foreground color for the bitmap or modular pattern.

-bg color
    Sets the background color for the bitmap or modular pattern.

-rv
    Reverses the foreground and background colors.

-solid color
    Sets the root window to a solid color.

DESCRIPTION

xsetroot allows you to customize the appearance of the X server's root window. The root window is the background behind all other windows on your screen. You can use xsetroot to set a solid color, a tiled pixmap (image), or a cursor. It's often used in startup scripts or configuration files to personalize the desktop environment. xsetroot primarily works by changing X server properties associated with the root window. These properties are then typically interpreted by window managers or desktop environments to render the visual changes. Some desktop environments may override xsetroot settings with their own background management features. The command is very simple to use. But not all display managers apply it so the user has to find another way to configurate the background.

CAVEATS

Many modern desktop environments ignore xsetroot settings, providing their own background management tools.
The effect of this command can be overwritten.

COLOR NAMES

The color parameter can be a color name from the rgb.txt file or a hexadecimal color value (e.g., #RRGGBB).

EXAMPLES

  • Set a solid blue background: xsetroot -solid blue
  • Set a black background with a white crosshatch pattern: xsetroot -mod 2 2 -fg white -bg black
  • Set background from bitmap file: xsetroot -bitmap /path/to/bitmap.xbm -fg black -bg grey

HISTORY

xsetroot has been a part of the X Window System since its early days. It provided a simple way to customize the root window's appearance before sophisticated desktop environments with built-in background configuration tools became common. It was a crucial tool for personalizing X11 environments in the 1980s and 1990s, and it remains available for scripting and basic customization, though its relevance has diminished in GUI-rich environments.

SEE ALSO

xset(1), xwd(1), xrdb(1)

Copied to clipboard