Skip to content

MiniApollo/dynamic-wallpaper-wayland

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

❖Dynamic-wallpaper-wayland ❖

GitHub Repo stars GitHub last commit GitHub repo size

Inspired by adi1090x/dynamic-wallpaper

Description

  • Dynamic wallpaper for wayland and xorg
  • Only 5 lines of code (wayland) and only 3 lines with Xorg
  • Easily customizable (default: firewatch)

Dependencies

  • git: To clone the repository
  • cron : To set a scheduler

Note Choose what you use (wayland or xorg)
If you want to use xorg change the comments as seen below

  • swaybg: To set wallpapers on wayland
  • feh : To set wallpapers on xorg

Install cron swaybg

# On Ubuntu or Debian
sudo apt-get install swaybg cron

# On Fedora
sudo dnf install swaybg cronie

# On Arch
sudo pacman -S swaybg cronie

# On Gentoo (I personaly use dcron)
doas emerge --ask swaybg dcron

# On Void (Install your favorite cron)
doas xbps-install -S swaybg <cron of your choice>

🔧 Installation

📎 Standard

Warning Some additional configuration maybe required

1. Clone the repository.

Note I personally create a folder in my home directory (called SystemFiles) and clone the repository there.

cd
mkdir SystemFiles
cd SystemFiles/
git clone https://github.com/MiniApollo/dynamic-wallpaper-wayland.git

2. Setup cron job.

Note In order to use this script you need to setup a cron job
1. First intall cron
2. After installing cron, enable and start the cron service

  • Systemd users (most people linux mint, ubuntu, debian, arch, fedora etc.)
sudo systemctl enable cronie.service --now

Note Install what you like (I personaly use dcron)

doas rc-update add dcron default

Note Install what you like

doas ln -s /etc/sv/<service-name> /var/service/
  • Other init system users (I think you get the point)

3. Make a cron job.

Note you need to add the following enviroment variables

echo "$WAYLAND_DISPLAY | $DISPLAY | $XDG_RUNTIME_DIR"
## My output
wayland-1 | :0 | /run/user/1000
crontab -e
# Add this line replacing the values of env variable and style with yours
0 * * * * WAYLAND_DISPLAY=wayland-1 DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/1000 $HOME/SystemFiles/dynamic-wallpaper-wayland/wallpaper.sh

Warning Don't forget to change $HOME/SystemFiles if you placed it somewhere else

4. Change script variables.

Note optional

  • Open the wallpaper.sh file with your favorite text editor
## Change the DIR variable accordingly where you want to place it
DIR="$HOME/SystemFiles/dynamic-wallpaper-wayland/images/firewatch/"
  • You can use it with Xorg just change the comments
## Xorg
## If you want to use xorg just uncomment the line bellow and comment the wayland lines above
feh --bg-fill $DIR$HOUR.png

📑 How to add own wallpapers

  • Download a wallpaper set you like.
  • Rename the wallpapers (must be jpg/png) to 0-23. If you don't have enough images, symlink them.
  • Make directory to $HOME/SystemFiles/dynamic-wallpaper/images/
  • Rename DIR variable to DIR="$HOME/SystemFiles/dynamic-wallpaper/images/yourWallpaperDirName

Uninstall

  • Delete the folder where you git cloned it
  • Run crontab -r to remove the hour scheduler
crontab -r
  • Unistall dependencies(git, cron, swaybg, feh) if its not needed

Sources

Thanks for reading!

alt dwall