LinuxCommandLibrary

xsetroot

Set X root window appearance

TLDR

Set solid background color

$ xsetroot -solid [blue]
copy
Set gray background
$ xsetroot -gray
copy
Set background from bitmap
$ xsetroot -bitmap [pattern.xbm]
copy
Create plaid pattern
$ xsetroot -mod [4] [4] -fg [red] -bg [white]
copy
Set cursor by name
$ xsetroot -cursor_name [left_ptr]
copy
Reset to defaults
$ xsetroot -def
copy
Set root window name
$ xsetroot -name "[status text]"
copy

SYNOPSIS

xsetroot [options]

DESCRIPTION

xsetroot configures the appearance of the X root window (desktop background). It can set solid colors, patterns, bitmap tiles, and the root window cursor.
The tool is commonly used in window manager startup scripts to set initial background appearance. Only one background option (-solid, -gray, -bitmap, or -mod) can be used at a time.
The -name option sets the root window's WM_NAME property, which some window managers use for status display (e.g., dwm displays it in the status bar).
For more sophisticated backgrounds, consider using tools like feh or nitrogen.

PARAMETERS

-solid color

Set background to solid color.
-gray, -grey
Set background to gray mesh pattern.
-bitmap file
Tile background with bitmap file.
-mod x y
Create plaid pattern (x, y: 1-16).
-fg, -foreground color
Foreground color for patterns.
-bg, -background color
Background color for patterns.
-rv, -reverse
Swap foreground and background colors.
-cursor font mask
Set cursor from font glyphs.
-cursor_name name
Set cursor by standard X cursor name.
-xcf file size
Set cursor from Xcursor file.
-def, -default
Reset to default settings.
-name string
Set root window name property.
-d, -display display
X server to connect to.
-help
Display help.
-version
Display version.

CAVEATS

Bitmap files must be in XBM format. Colors use X color names or hex values (#RRGGBB). Some compositing window managers may override root window appearance. The -name option is used by dwm for status bar text.

HISTORY

xsetroot has been part of the X Window System since early releases. It provides basic root window customization following the Unix philosophy of simple, focused tools. Many users now prefer more feature-rich tools like feh for wallpapers.

SEE ALSO

feh(1), nitrogen(1), xwallpaper(1), hsetroot(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community