A webui/sync program to change your wallpapers.
Find a file
2025-07-20 14:47:44 +02:00
client Client downloads are now async 2024-08-31 22:15:00 +02:00
scripts Update README.md 2025-07-20 14:44:31 +02:00
server Commented 2024-08-31 09:05:44 +02:00
.gitignore saving progress 2024-09-06 23:50:40 +02:00
Cargo.toml Client downloads are now async 2024-08-31 22:15:00 +02:00
docker-compose.yml nginx 2024-08-31 08:41:13 +02:00
Dockerfile docker 2024-08-31 00:05:21 +02:00
LICENSE Initial commit 2024-08-29 11:38:48 +02:00
nginx.conf nginx 2024-08-31 08:41:13 +02:00
README.md Update README.md 2025-07-20 14:47:44 +02:00

DynamicWallpaper

A web UI and synchronization program to change your wallpapers.

(Well, rsync is simpler and better! Anyway, it was fun to program DynamicWallpaper myself.)

Explanation

The server/web UI component acts as the interface for users to add or delete images.

The client/sync should be run at intervals to keep the local images in sync with the server. Then, use any wallpaper program (such as feh) to set your wallpaper from the local collection.

Simply Put

  • You upload images to the web UI (you can delete them too).

  • You run the client component, and images from the web UI server will be synced to your local directory.

  • Then, use your favorite wallpaper program to select a random image from your locally synced directory.

Why?

  • Learning opportunity.
  • Allows multiple computers and friends to share the same collection of wallpapers.

Installation

Server (Docker)

Tip

For a non-Docker installation, the user should follow the standard Rust building procedure inside of the server directory. Click here for more information.

Requirements

  • Docker and Docker Compose (see the Docker website for installation).

Steps

  1. Clone the repo

    git clone https://github.com/Urpagin/DynamicWallpaper.git

  2. Create a .env file at the same level as docker-compose.yml and add these variables:

PORT=<exposed port>
NGINX_USER=<user for web UI auth>
NGINX_PASSWORD=<password for webui auth>
  1. Start the containers: sudo docker compose up -d --build

Tip

The --build argument rebuilds the container so that code updates are reflected in the container.

  1. Visit 127.0.0.1:<PORT> to access the app.

Note

Once you have started the app via Docker Compose, the wallpapers_server directory will contain the wallpapers.

Client

This part is a little more hazardous. You can try running the scripts/install_arch_linux_systemctl.py script; this program might work on your machine.
It requires systemd and has been tried only on Arch Linux.

Note

The recommended method is as follows:

I recommend manually building the client component (see the TIP on how to do that under the Server (Docker) section).
Then copy and populate the scripts/update_wallpaper_feh.sh wherever you'd like and make it autostart by executing the script in a startup file like ~/.xinitrx, ~/.xsession if you're on X11 or place exec-once = path/to/script.sh & in ~/.config/hypr/hyprland.conf if you're using Wayland + Hyprland.

Otherwise, you can directly interact with the produced binary using this argument convention:

./client \
  --endpoint "<your endpoint, e.g., https://wallpapers.yourdomain.com>" \
  --directory "<directory path where to store the downloaded images>" \
  --user "<(optional) NGINX simple auth>" \
  --password "<(optional) NGINX simple auth>"

Security

I am a beginner, so I cannot guarantee that there are no security vulnerabilities.

This is one of the reasons I should add a password. On that note, adding a password-protected proxy (such as NGINX) would be an easier and simpler option. (That is what happens if you decide to run the server component with the provided docker-compose.yml; A simple password-protected proxy using NGINX is set up.)