Home

Awesome

<!-- Dynamic Wallpaper --> <p align="center"> <img src="https://raw.githubusercontent.com/adi1090x/files/master/dynamic-wallpaper/logo.png"> </p> <p align="center"> <img src="https://img.shields.io/badge/Maintained%3F-Yes-green?style=for-the-badge"> <img src="https://img.shields.io/github/license/adi1090x/dynamic-wallpaper?style=for-the-badge"> <img src="https://img.shields.io/github/stars/adi1090x/dynamic-wallpaper?style=for-the-badge"> <img src="https://img.shields.io/github/issues/adi1090x/dynamic-wallpaper?color=violet&style=for-the-badge"> <img src="https://img.shields.io/github/forks/adi1090x/dynamic-wallpaper?color=teal&style=for-the-badge"> </p> <p align="center">A simple <code>bash</code> script to set wallpapers according to current time, using <b>cron job scheduler</b>.</p>

gif <br />

Overview

Dependencies

Install Following programs on your system before using dwall -

Install feh, cron and xrandr -

# On Archlinux
$ sudo pacman -Sy xorg-xrandr feh cronie

# On Ubuntu or Debian
$ sudo apt-get install x11-xserver-utils feh cron

For swaywm support users must install oguri. The oguri daemon must be started for the script to work. Oguri can be installed on Arch linux via AUR.

Installation

Follow the step below to install dwall on your system -

You can run test.sh to test it before installing it on your system.

$ git clone https://github.com/adi1090x/dynamic-wallpaper.git
$ cd dynamic-wallpaper
$ chmod +x install.sh
$ ./install.sh

Run the program

$ dwall

╺┳┓╻ ╻┏┓╻┏━┓┏┳┓╻┏━╸   ╻ ╻┏━┓╻  ╻  ┏━┓┏━┓┏━┓┏━╸┏━┓
 ┃┃┗┳┛┃┗┫┣━┫┃┃┃┃┃     ┃╻┃┣━┫┃  ┃  ┣━┛┣━┫┣━┛┣╸ ┣┳┛
╺┻┛ ╹ ╹ ╹╹ ╹╹ ╹╹┗━╸   ┗┻┛╹ ╹┗━╸┗━╸╹  ╹ ╹╹  ┗━╸╹┗╸

Dwall V3.0   : Set wallpapers according to current time.
Developed By : Aditya Shakya (@adi1090x)

Usage : test.sh [-h] [-p] [-s style]

Options:
   -h	  Show this help message
   -p	  Use pywal to set wallpaper
   -s	  Name of the style to apply
   
Available styles:  aurora  beach  bitday  chihuahuan  cliffs  colony  desert  earth  exodus
factory  firewatch  forest  gradient  home  island  lake  lakeside  market  mojave  moon
mountains  room  sahara  street  tokyo  

Examples: 
test.sh -s beach       Set wallpaper from 'beach' style
test.sh -p -s sahara   Set wallpaper from 'sahara' style using pywal
$ dwall -s firewatch
[*] Using style : firewatch

Setup cron job

This program is specifically created to use with a time-based job scheduler such as cron or systemd/Timers. So, After installing this program you need to set up a cron job using crontab on your system. Follow the step below to set a job for this program -

I'm using cronie on Arch Linux here.

# On Arch Linux
$ sudo systemctl enable cronie.service --now
$ systemctl status cronie.service
● cronie.service - Periodic Command Scheduler
     Loaded: loaded (/usr/lib/systemd/system/cronie.service; enabled; vendor preset: disabled)
     Active: active (running) since Sat 2020-12-26 14:39:31 IST; 5h 22min ago
   Main PID: 779 (crond)
$ echo "$SHELL | $PATH | $DISPLAY | $DESKTOP_SESSION | $DBUS_SESSION_BUS_ADDRESS | $XDG_RUNTIME_DIR"

/usr/bin/zsh | /usr/local/bin:/usr/bin | :0 | Openbox | unix:path=/run/user/1000/bus | /run/user/1000
# export editor for crontab
$ export EDITOR=vim

# Edit your crontab and add a job
$ crontab -e

# Add this line replacing the values of env variable and style with yours
0 * * * * env PATH=/usr/local/bin:/usr/bin DISPLAY=:0 DESKTOP_SESSION=Openbox DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus" /usr/bin/dwall -s firewatch

# check if job is created on your crontab
$ crontab -l
0 * * * * env PATH=/usr/local/bin:/usr/bin DISPLAY=:0 DESKTOP_SESSION=Openbox DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus" /usr/bin/dwall -s firewatch
# delete previous job
$ crontab -r

# Add new job with different style
$ crontab -e
0 * * * * env PATH=/usr/local/bin:/usr/bin DISPLAY=:0 DESKTOP_SESSION=Openbox DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus" /usr/bin/dwall -s bitday

How to add own wallpapers

Tips

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.

# On Archlinux
$ sudo pacman -Sy libheif

# On Ubuntu or Debian
$ sudo apt-get install libheif-examples

# change to directory
$ cd Downloads/heic_images

# convert to jpg images
$ for file in *.heic; do heif-convert $file ${file/%.heic/.jpg}; done

More Wallpapers : I've also created a few more wallpaper sets, which are not added to this repository because of their big size. You can download these wallpapers set from here -

<p align="center"> <a href="https://github.com/adi1090x/files/tree/master/dynamic-wallpaper/wallpapers"><img alt="undefined" src="https://img.shields.io/badge/Download-Here-blue?style=for-the-badge&logo=github"></a> </p>

Available Sets : Catalina, London, Maldives, Mojave HD, Mount Fuji, Seoul, and more...

Previews

AuroraBeachBitdayChihuahuan
gifgifgifgif
CliffsColonyDesertEarth
gifgifgifgif
ExodusFactoryForestGradient
gifgifgifgif
HomeIslandLakeLakeside
gifgifgifgif
MarketMojaveMoonMountains
gifgifgifgif
RoomSaharaStreetTokyo
gifgifgifgif

Common Issues

1. Wallpaper not changing : If your wallpaper is not changing, then open an issue and show me the output of echo $DESKTOP_SESSION.

2. Not working on XFCE : If this script is not working on xfce, then open the terminal and run xfconf-query -c xfce4-desktop -m and change the wallpaper (any) via xfce4-settings-manager. <br /> In the terminal, xfconf-query will print lines starting with set:, which show which properties have been changed, check screen & monitor values and modify the script accordingly.

109   ## For XFCE
110   if [[ "$OSTYPE" == "linux"* ]]; then
111      SCREEN="0"
112      MONITOR="1"
113   fi

  1. Autostart : If you want to autostart the script with desktop, you can add it to your WM autostart file & if it doesn't work for you, you can create a desktop file in $HOME/.config/autostart dir.
$ cd $HOME/.config/autostart && touch dwall.desktop

# Add this to dwall.desktop file

[Desktop Entry]
Name=Dynamic Wallpaper
Comment=Set desktop background according to current time.
Exec=/usr/bin/dwall -s firewatch &
Type=Application
Icon=wallpaper
Categories=Accessories;

Alternatively, you can also put the /usr/bin/dwall -s firewatch & command in your ~/.bashrc file.

Quick FYI