Skip to content

AinaKANTY/dynamic-wallpaper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple bash script to set wallpapers according to current time, supporting multiple desktop environments and window managers.

gif

Overview

  • Wallpaper setter: Automatically detected based on your environment.
  • Multi-environment: Automatically detects and supports your DE/WM.
  • Smart Time Fallback: If an image for the current hour is missing, dwall automatically 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 .gif formats simultaneously.
  • Dynamic Theming: Supports Matugen and Pywal for automatic color scheme generation (optional).
  • Scheduler: Compatible with Systemd Timers and Cronie.

Roadmap (TODO)

  • Multi-monitor support — Set a different wallpaper per screen
  • Plugin support — To have more functionality while remaining lightweight
  • Weather-aware wallpapers — A plugin for detect current weather and location to automatically overlay or switch wallpapers matching real-time weather conditions (rain, sun, snow, fog...)

Supported Environments

Wayland

Hyprland Sway Wayfire Niri Wayland

X11

GNOME KDE XFCE MATE Cinnamon LXDE X11

Color Generation (optional)

matugen pywal

The script uses Matugen by default if installed, and falls back to Pywal if Matugen does not exist.

Dependencies

  • systemd or cronie: For the hourly timer.
  • Wallpaper Setters (install at least one based on your environment if not using a full DE):
    • Wayland: awww, hyprpaper, swaybg, wpaperd, or wbg.
    • X11: feh, nitrogen, hsetroot, or xwallpaper.
    • DEs: their built-in native tools.
  • matugen: For Material You dynamic colors (optional).
  • pywal: For dynamic color schemes (optional).

Installation

  1. Clone the repository:
git clone https://github.com/AinaKANTY/dynamic-wallpaper.git
cd dynamic-wallpaper
  1. Install
chmod +x install.sh
./install.sh

Automation

Systemd Timer

  1. Create the service (~/.config/systemd/user/dwall@.service):
[Unit]
Description=Dynamic Wallpaper

[Service]
ExecStart=/usr/bin/dwall -s %i
  1. Create the timer (~/.config/systemd/user/dwall.timer):
[Unit]
Description=Dynamic Wallpaper Timer

[Timer]
OnCalendar=hourly
Persistent=true

[Install]
WantedBy=timers.target
  1. Enable:
systemctl --user enable --now dwall@<style>.timer # replace <style> by yours

Cronie

  1. 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/
  1. Make sure the service is running:
systemctl status cronie
  1. 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)='
  1. Open crontab and add your values:
crontab -e
# Replace variables and style with your own values
0 * * * * DISPLAY=:0 WAYLAND_DISPLAY=wayland-1 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus /usr/bin/dwall -s beach
  1. Verify the cron job is registered:
crontab -l

Integration with Matugen

To make your window borders and UI match the wallpaper automatically with Matugen:

  1. Update your Hyprland config: Add this line to your ~/.config/hypr/hyprland.conf:
source = ~/.config/hypr/colors.conf
  1. Configure Matugen output: Create ~/.config/matugen/config.toml:
[config.outputs.hyprland]
path = "~/.config/hypr/colors.conf"
template = "hyprland.desktop"
  1. Use the variables:
general {
    col.active_border = $primary
    col.inactive_border = $surface_variant
}

How to add own wallpapers

  1. Download a wallpaper set you like.
  2. Rename the wallpapers to match the hours of the day: 0 to 23 (e.g., 0.jpg for midnight, 12.png for noon).

    Note: Thanks to the Smart Fallback feature, you don't need exactly 24 images! If you only have images for 6, 12, and 18, the script will automatically keep showing 6.jpg until 12:00. No need to create symlinks!

  3. Make a new directory in /usr/share/dynamic-wallpaper/images/ (e.g., mystyle) and copy your images into it.
  4. Run the program to test: dwall -s mystyle.

Tips

  • You can use dwall to change between your favorite wallpapers every hour.
  • You can use dwall as picture slide, which can set your favorite photos as wallpaper every hour or every 15 minutes. Just create an appropriate timer.

Use HEIC Images

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 wallpaper file you like and follow the steps below to convert images.

  • First install heif-convert on 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 .heic file 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

undefined

Credits

About

A simple bash script to set wallpapers according to current time, supporting multiple desktop environments and window managers.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Shell 100.0%