nitrogen
Set desktop background images
TLDR
View and set the wallpapers from a specific directory
Set the wallpaper with automatic size settings
Restore the previous wallpaper
SYNOPSIS
nitrogen [options] [directory...]
PARAMETERS
--help
Display help information and exit.
--version
Output version information and exit.
--set-auto
Automatically determine the best fit for the selected image (e.g., zoom, fill, etc.).
--set-scaled
Scale the image to fit the screen, maintaining aspect ratio. Pads with background color if necessary.
--set-centered
Center the image on the screen. Pads with background color if necessary.
--set-zoom
Zoom the image to fill the screen, maintaining aspect ratio. Image may be cropped.
--set-tiled
Tile the image across the screen.
--set-fill
Stretch the image to fill the screen completely, ignoring aspect ratio.
--set-color=RRGGBB
Set a solid background color using an RGB hexadecimal value (e.g., 000000 for black). This color is used for padding with some --set modes.
--random
Select a random image from the configured directories and set it as wallpaper.
--recursive
Recursively scan specified directories for images.
--head=NUM
Specify which monitor (Xinerama head) to apply the wallpaper to in a multi-monitor setup. NUM is the head index (0-indexed).
--save
Save the current wallpaper settings (image path, scaling mode, color) to the configuration file.
--restore
Restore the last saved wallpaper settings. Often used in autostart scripts.
--prev
Go to the previous image in the history/list of displayed wallpapers.
--next
Go to the next image in the history/list of displayed wallpapers.
--sort=mode
Sort images by alpha (alphabetical filename) or xinerama (by Xinerama head, for multi-monitor display).
directory...
One or more directories to scan for images. These paths are added to Nitrogen's list of image folders.
DESCRIPTION
Nitrogen is a lightweight, graphical utility designed for setting desktop wallpapers in X Window System environments. Unlike heavier desktop environments, Nitrogen offers a minimalistic approach, making it particularly well-suited for standalone window managers such as Openbox, Fluxbox, i3, Awesome, and others that do not provide native wallpaper management. It allows users to browse image directories, preview wallpapers, and easily set them as their desktop background.
Key features include support for multiple monitor setups, where different wallpapers can be assigned to individual screens. Nitrogen provides various scaling options, including Zoom, Scaled, Centered, Tiled, and None, ensuring wallpapers fit perfectly regardless of resolution. It also allows for setting a background color when the image doesn't fill the screen. Configuration settings, such as image paths and wallpaper choices, are saved, allowing Nitrogen to be run on startup (e.g., via ~/.xinitrc or ~/.config/openbox/autostart) to automatically restore the desired background. Its simplicity and low resource consumption make it a popular choice among users seeking a flexible and efficient wallpaper solution.
CAVEATS
Nitrogen is specifically designed for the X Window System and will not function in Wayland environments. While it offers a simple and effective wallpaper solution for lightweight window managers, users of full desktop environments like GNOME or KDE might find their integrated wallpaper settings more convenient or feature-rich. Nitrogen also does not support animated wallpapers or video backgrounds.
CONFIGURATION FILES
Nitrogen saves its settings in the user's home directory, typically in ~/.config/nitrogen/. The bg-saved.cfg file stores the path and mode of the last set wallpaper, while nitrogen.cfg contains general application settings, including the list of image directories.
AUTOSTART INTEGRATION
To automatically restore the wallpaper on system startup, Nitrogen is often called with the --restore option in a user's autostart script (e.g., ~/.xinitrc, ~/.config/openbox/autostart, or similar files depending on the window manager). For example: nitrogen --restore &
HISTORY
Nitrogen was created by Alex Smith as a lightweight and efficient solution for managing desktop wallpapers in X environments. It quickly gained popularity among users of minimalistic window managers due to its small footprint and independence from heavy desktop environments. Its development has focused on providing a stable and reliable tool for a core task, becoming a staple in many "dotfiles" setups for automatically restoring wallpapers on system startup.