client | ||
scripts | ||
server | ||
.gitignore | ||
Cargo.toml | ||
docker-compose.yml | ||
Dockerfile | ||
LICENSE | ||
nginx.conf | ||
README.md |
DynamicWallpaper
A web UI and synchronization program to change your wallpapers.
(Yes, rsync
is simpler and better. Anyway, it was fun to program DynamicWallpaper.)
Explanation 🧩
The server and web UI let users add and delete images.
The client sync tool should be run at intervals to keep 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 ✨
- Upload images through the web UI. You can delete them too.
- Run the client. Images from the server are synced to a local directory.
- Use your favorite wallpaper tool to pick a random image from that local directory.
Why ❓
- Learning opportunity.
- Lets multiple computers and friends share the same wallpaper collection.
Installation 🧰
Server (Docker) 🐳
Tip
For a non-Docker installation, follow the standard Rust build workflow inside the
server
directory. Click here for more information.
Requirements
- Docker and Docker Compose
Steps
-
Clone the repo
git clone https://github.com/Urpagin/DynamicWallpaper.git
-
Create a
.env
file next todocker-compose.yml
and add:PORT=<exposed port> NGINX_USER=<user for web UI auth> NGINX_PASSWORD=<password for web UI auth>
-
Start the containers
sudo docker compose up -d --build
Tip
The
--build
flag rebuilds the image so code updates are reflected.
- Open
http://127.0.0.1:<PORT>
to access the app.
Note
Once the stack is running, the
wallpapers_server
directory will contain the wallpapers.
Client 🖥️
This part is a little more hazardous. You can try running scripts/install_arch_linux_systemctl.py
. This script requires systemd and has been tested only on Arch Linux.
Note
Recommended approach
Build the
client
component manually (see the tip in the Server (Docker) section). Then copyscripts/update_wallpaper_feh.sh
somewhere convenient, make it executable, and have it autostart.cargo build --release -p client chmod +x /path/to/update_wallpaper_feh.sh
On X11, invoke the script from a startup file like
~/.xinitrc
or~/.xsession
. On Wayland with Hyprland, add a line likeexec-once = /path/to/update_wallpaper_feh.sh &
to~/.config/hypr/hyprland.conf
.
You can also manually invoke the client binary directly with these arguments:
Note
The example assumes you are protecting the server behind NGINX basic auth.
./client \
--endpoint "https://wallpapers.yourdomain.com" \
--directory "/path/to/downloaded/images" \
--user "<optional basic auth user>" \
--password "<optional basic auth password>"
Security 🔒
I am a beginner, so I cannot guarantee there are no vulnerabilities.
The provided Docker Compose setup includes a simple password-protected proxy using NGINX.