A lightweight Bash script to bring your Linux desktop to life. This script allows you to use videos (MP4, MKV, WebM), GIFs, or static images as your wallpaper (and other X11-based environments). It features a toggle behavior, random selection from a folder, and proper window layering to stay behind your icons.
- Video Support: Uses
mpvto loop videos or GIFs seamlessly. - Smart Toggling: Run the script once to start the wallpaper; run it again to kill it.
- Auto-scaling: Automatically detects your monitor resolution for a perfect fit.
- Randomized or Specific: Pick a random file from your collection or pass a specific file path as an argument.
- Desktop Integration: Uses
xpropto set the window type to "Desktop," ensuring it stays beneath your windows and icons.
Ensure you have the following dependencies installed:
- mpv: For video playback.
- xdotool: To find the window ID.
- x11-utils (xprop): To set window properties.
- feh: (Optional) For static image support.
- xrandr: To detect monitor geometry (usually pre-installed).
# Example for Ubuntu/Debian/Mint:
sudo apt install mpv xdotool x11-utils feh
- Clone the repository or download the script.
- Make it executable:
chmod +x live-wallpaper-launcher.sh
- Set your wallpaper directory:
Open the script and edit the
CUSTOM_FOLDERvariable to point to your videos:
CUSTOM_FOLDER="$HOME/Path/To/Your/Wallpapers"
Simply run the script. If no wallpaper is running, it picks a random one. If one is already running, it closes it.
./live-wallpaper-launcher.sh
./live-wallpaper-launcher.sh /path/to/awesome-video.mp4
For the best experience, map this script to a keyboard shortcut (e.g., Super + W) in your Keyboard settings to toggle your live background instantly.
This script works by launching mpv as a borderless window and then using xprop to force the X Window System to treat it as a "Desktop" layer. This is specifically tuned for X11; it will not work on Wayland.