A simple bash script to set wallpapers according to current time, supporting multiple desktop environments and window managers.
- Wallpaper setter: Automatically detected based on your environment.
- Multi-environment: Automatically detects and supports your DE/WM (Wayland & X11).
- Target specific monitors: Apply a wallpaper to a specific screen using the
-mor--monitorflag (supports Hyprland, Sway, KDE, and XFCE). - Random Selection: Pick a random style from your installed ones using the
-ror--randomflag. - Manage Styles: Easily remove an installed style using the
dwall rm <style>subcommand. - Smart Time Fallback: If an image for the current hour is missing,
dwallautomatically falls back to the previous available hour. You don't need exactly 24 images! - Multi-Format Auto-detection: Seamlessly searches for
.jpg,.jpeg,.png,.webp, and.gifformats simultaneously. - Dynamic Theming: Supports Matugen (default) and Pywal (via
-pflag) for automatic color scheme generation. - Safety First: Features a robust
flockinstance locking system to prevent overlapping runs, along with clean exits on system signals. - Scheduler: Compatible with Systemd Timers and Cronie.
The script uses Matugen by default if installed. If you prefer to use Pywal, you can force it by passing the -p or --pywal flag.
systemdorcronie: For the hourly timer.- Wallpaper Setters (install at least one based on your environment if not using a full DE):
- Wayland:
awww,hyprpaper,swaybg, orwbg. (Note:wpaperdis not supported). - X11:
feh,nitrogen,hsetroot, orxwallpaper. - DEs: their built-in native tools.
- Wayland:
matugen: For Material You dynamic colors (optional).pywal: For dynamic color schemes (optional).
- Clone the repository:
git clone https://github.com/AinaKANTY/dynamic-wallpaper.git
cd dynamic-wallpaper- Install
chmod +x install.sh
./install.shUsage: dwall [OPTION...]
dwall rm <style>
Options:
-h, --help Show help message
-p, --pywal Use pywal to set terminal colors instead of matugen
-s, --style <style> Name of the style to apply
-S, --setter <setter> Force a specific wallpaper setter
-m, --monitor <name> Target a specific monitor (ex: DP-1, eDP-1)
-l, --list List available styles
-r, --random Pick a random style- Create the service (
~/.config/systemd/user/[email protected]):
[Unit]
Description=Dynamic Wallpaper
[Service]
ExecStart=/usr/bin/dwall -s %i- Create the timer (
~/.config/systemd/user/dwall.timer):
[Unit]
Description=Dynamic Wallpaper Timer
[Timer]
OnCalendar=hourly
Persistent=true
Unit[email protected]
[Install]
WantedBy=timers.target- Enable:
systemctl --user enable --now dwall.timer
systemctl --user start dwall@<style>.service # replace <style> by yours- Enable and start the cron daemon:
# systemd
sudo systemctl enable --now cronie
# runit (Artix/Void)
sudo ln -s /etc/runit/sv/cronie /run/runit/service/- Make sure the service is running:
systemctl status cronie- Get your environment variables:
env | grep -E '^(SHELL|DISPLAY|WAYLAND_DISPLAY|XDG_SESSION_TYPE|XDG_CURRENT_DESKTOP|DESKTOP_SESSION|DBUS_SESSION_BUS_ADDRESS|XDG_RUNTIME_DIR|HYPRLAND_INSTANCE_SIGNATURE|SWAYSOCK|NIRI_SOCKET|WAYFIRE_SOCKET|COSMIC_SESSION)='- Open crontab and add your values:
crontab -e# Replace <value> and <style> with your own values
# X11
0 * * * * DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus /usr/bin/dwall -s <style>
# Wayland — Hyprland (replaces the value of HYPRLAND_INSTANCE_SIGNATURE with the one obtained in step 3)
0 * * * * XDG_RUNTIME_DIR=/run/user/1000 WAYLAND_DISPLAY=wayland-1 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus HYPRLAND_INSTANCE_SIGNATURE=<value> /usr/bin/dwall -s <style>
# Wayland — Sway
0 * * * * XDG_RUNTIME_DIR=/run/user/1000 WAYLAND_DISPLAY=wayland-1 SWAYSOCK=<value> /usr/bin/dwall -s <style>- Verify the cron job is registered:
crontab -l- Download a wallpaper set you like.
- Rename the wallpapers to match the hours of the day:
0to23(e.g.,0.jpgfor midnight,12.pngfor noon).Note: Thanks to the Smart Fallback feature, you don't need exactly 24 images! If you only have images for
6,12, and18, the script will automatically keep showing6.jpguntil noon. - Make a new directory in
/usr/share/dynamic-wallpaper/images/(e.g.,mystyle) and copy your images into it. - Run the program to test:
dwall -s mystyle.
Tips
- You can use
dwallto change between your favorite wallpapers every hour. - You can use
dwallas a picture slide, which can set your favorite photos as wallpaper every hour or every 15 minutes. Just create an appropriate timer.
You may also want to use wallpapers from Dynamic Wallpaper Club. To do so, you need to convert .heic image file to either png or jpg format. Download a .heic image and extract it.
- First install
heif-converton your system:
# Arch/Manjaro
sudo pacman -S libheif
# Debian/Ubuntu
sudo apt install libheif-examples
# RedHat/Fedora
sudo dnf install libheif libheif-tools- Move your
.heicfile in a directory and run following command to convert images.
# change to directory
cd Downloads/
# convert to jpg images
for file in *.heic; do heif-convert "$file" "${file/%.heic/.jpg}"; done- Now, you have the images, just follow the above steps to use these wallpapers with
dwall.
More Wallpapers : The original author also created additional wallpaper sets, which are not added to this repository because of their big size. You can download these wallpapers set from here
- Original Author: Aditya Shakya (@adi1090x).
- License: Distributed under the GPL-3.0 License.

