LinuxAlternative

Linux · System Tools

hsetroot

hsetroot is a lightweight command-line tool to set and manipulate the desktop background on Linux systems using X11.

Open sourceFree
Be the first to rate
License
MIT
Latest version
1.1.0

What is hsetroot?

hsetroot is a minimal utility designed to set the root window background in X11 environments. It supports basic image scaling, tiling, and color blending, making it useful in minimal window managers or script-driven setups. Developed years ago, it remains stable and widely available across major distributions.

It's best suited for users who avoid desktop environment bloat and prefer control via scripts or configuration files. Think tiling window manager users, system administrators, or those building custom desktop environments. It doesn’t integrate with GUI settings panels or offer live previews.

Compared to Windows Spotlight, which automatically rotates background images with internet content, hsetrock is static and manual. There’s no automatic fetching or curation. You won’t get new images daily, but you gain full control over appearance and performance with minimal resource use.

Best for: Users who want precise, scriptable control over their desktop background without desktop environment bloat.

Key features of hsetroot

  • Sets desktop background from image files
  • Supports JPEG, PNG, and other common formats via Imlib2
  • Allows solid color backgrounds
  • Scales, centers, or tiles images
  • Blends images with background colors
  • Runs non-interactively in scripts
  • Lightweight, no GUI dependencies

Pros

  • Extremely lightweight and fast
  • Works well in minimal or custom desktop environments
  • Scriptable for automation
  • Available in most distro repositories
  • Stable and predictable behavior

Cons

  • No GUI or system tray interface
  • Limited to X11, not designed for Wayland
  • No automatic image rotation or downloads

Windows programs hsetroot replaces

How to install hsetroot on Linux

Ubuntu / Mintsudo apt install hsetroot
Debiansudo apt install hsetroot
Fedorasudo dnf install hsetroot
Arch / Manjarosudo pacman -S hsetroot
openSUSEsudo zypper install hsetroot

Tips for Windows users

If you're used to Windows Spotlight changing your background automatically, you'll need to set up a cron job or systemd user timer with hsetroot to rotate images manually. Store your images locally, as hsetroot doesn’t fetch them. Use common formats like JPG or PNG, and combine with tools like feh or imagemagick for advanced effects.

hsetroot: frequently asked questions

Does hsetroot work with Wayland?

No, hsetroot only works on X11. Wayland compositors handle backgrounds differently, often requiring tools like swaybg or compositor-specific settings.

How do I set a background with hsetroot?

Run hsetroot -fill /path/to/image.jpg to stretch an image, or use -center, -tile, or -solid for other modes.

Can hsetroot rotate wallpapers automatically?

Not built-in, but you can script it using a loop and sleep in a shell script or cron job to change the background at intervals.

What image formats does hsetroot support?

It supports formats handled by Imlib2, including JPEG, PNG, BMP, and GIF. Check your system's Imlib2 build for exact support.

Updated