Skip to content

Drago241/Live-Wallpaper-Script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

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.

✨ Features

  • Video Support: Uses mpv to 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 xprop to set the window type to "Desktop," ensuring it stays beneath your windows and icons.

πŸ›  Prerequisites

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

πŸš€ Installation & Setup

  1. Clone the repository or download the script.
  2. Make it executable:
chmod +x live-wallpaper-launcher.sh
  1. Set your wallpaper directory: Open the script and edit the CUSTOM_FOLDER variable to point to your videos:
CUSTOM_FOLDER="$HOME/Path/To/Your/Wallpapers"

πŸ“– Usage

Toggle Random Wallpaper

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

Launch a Specific File

./live-wallpaper-launcher.sh /path/to/awesome-video.mp4

Pro Tip: Keyboard Shortcut

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.

πŸ“ Technical Note

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.