Skip to main content

A simple program that sets random images as desktop wallpaper in *nix operating systems.

Project description

Nix Random Wallpaper

A simple program that sets random wallpaper images as desktop backgrounds in nix based operating systems / window managers. It fetches images from a local directory or Unsplash, composes a new image to match display size and arrangement, and sets the new image as the desktop background.

This project was forked from Gnome Random Wallpaper, which while great at its original limited scope, is no longer maintained.

Example arrangement

Example Arrangement

Example wallpaper

Example Wallpaper

Usage

Nix Random Wallpaper (nrw) currently makes the following assumptions about the user:

  • The user will configure some external scheduler to prompt the nrw command to run in the background
  • The user doesn't usually want to keep the generated wallpaper images forever
    • The last image that was generated is replaced by the newly generated image
    • The default output directory is /tmp/random - /tmp is commonly a tmpfs filesystem and exists only in memory (while the system remains powered on)
      • Note: The default output directory can and probably should be changed to a non-volatile location in configuration. Specifying a non-volatile directory will prevent temporary auto-selection of a system default wallpaper by the window manager on login after a fresh boot cycle, which can be disorienting.
  • The user won't interact directly with the program often, making command line argument support unnecessary

Simply running nrw will fetch images from either the Unsplash API or the image directory (images_dir) defined in configuration, then prepare and set the wallpaper based on the configured setter. In xorg, all setters resize and compose the images on a spanned canvas matching your current display arrangement, save the resulting wallpaper image to the output directory (output_dir), and update your desktop background. In wayland (currently only hyprland), images are placed on their own right-sized canvases, saved separately, and update the desktop background individually on each screen.

Some suggested steps to take in your environment:

  • Configure a cron job or timer of some sort to run nrw at regular intervals (every 15 minutes works well for me - */15 * * * * /path/to/nrw)
  • Configure a Startup Application to run nrw on login

Installation

Use the following command to install the nrw module from PyPi with pip:

pip install nrw

Or to install the latest version of the repository with pip:

pip install git+https://github.com/miliarch/nrw.git

After installation, a nrw executable link should be placed in your $HOME/.local/bin directory (this may vary depending on distro). If this directory is included in your PATH environment variable, the nrw command should be available for use without any further steps. Otherwise, you'll need to either specify the full path to run the program, or add the $HOME/.local/bin directory to your PATH environment variable.

Alternatively, clone this repository to your preferred installation directory and manually link ./nrw/nix_random_wallpaper.py in the execution directory of your choice.

Configuration

Default configuration can be found in nrw/config.yaml. This file can be copied to $HOME/.config/nix_random_wallpaper/config.yaml and modified to override the default options.

Each configuration option in the file includes an in-line comment that details its function. If you have any questions about how existing options behave, or requests for new options, please raise an issue in this repository.

Supported display configurations

Any number of displays that are arranged horizontally (side-by-side) within the vertical (height) bounds of the largest display should be supported.

Unsupported display configurations

Vertical arrangements, including mixed vertical/horizontal arrangements, are currently unsupported. Support may be implemented in the future.

Tested configurations

Window managers

  • Cinnamon 5.0.5-5.0.7 (xorg)
  • awesome v4.3 (xorg)
  • hyprland v0.39.1 (wayland)

Wallpaper setters

  • gnome (via gsettings; xorg only)
  • nitrogen (recommended for xorg)
  • hyprpaper (hyprland/wayland only)

Resolutions

  • 1920x1080
  • 2560x1440
  • 3840x2160

Display arrangements

  • Dual monitor, landscape orientation, horizontal arrangement (side-by-side)
  • In hyprland/wayland, images are set independently by active monitor instead of being placed on a large canvas; any arrangement should be supported

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nrw-0.7.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

nrw-0.7-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file nrw-0.7.tar.gz.

File metadata

  • Download URL: nrw-0.7.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.17

File hashes

Hashes for nrw-0.7.tar.gz
Algorithm Hash digest
SHA256 b9ba9e175615987ad1a91c63066f1642e759ae6d8891176c66aefcbf0f39e8e8
MD5 94ea2e0a06a55c4e0c922cc27836f3d0
BLAKE2b-256 c2c1104affa815b5d6873568af36b73900b4d10c4f85a484d5f1bc8d55b78cd3

See more details on using hashes here.

File details

Details for the file nrw-0.7-py3-none-any.whl.

File metadata

  • Download URL: nrw-0.7-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.17

File hashes

Hashes for nrw-0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 df7319e34e1cd68e84de0755947b8617024a385284fcb53b8131c6c0c267345d
MD5 172dfc2979dac81bc95eb55c8171c296
BLAKE2b-256 35ab741c925afece98bbdce121b6dec2e3e868548bf079a8eefac795aecf6869

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page