Skip to content

Commit

Permalink
video-wall: add init and dmenu selection scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
wizzdom committed Jan 3, 2024
1 parent 9d0221e commit 5936fd3
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
21 changes: 21 additions & 0 deletions video-wall-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Script to initialize the list of video wallpapers downloaded from the Wallpaper Engine Steam Workshop or other sources


# Path to the Wallpaper Engine Steam Workshop directory
WALLENGINE_DIR="/mnt/storage/SteamLibrary/steamapps/workshop/content/431960"
# Path to the directory where you store your own video wallpapers
VIDEOWALL_DIR="$HOME/Videos/wallpapers"
# Path to the file where the list of video wallpapers will be stored
LIST_FILE="/tmp/video-wallpapers"

# Get the list of video files from the Wallpaper Engine Steam Workshop
echo "Getting the list of video files from the Wallpaper Engine Steam Workshop..."
echo "This may take a while..."
find $WALLENGINE_DIR -type f -exec file -N -i -- {} + | grep video | cut --delimiter=":" --fields=1 | sort > $LIST_FILE
echo "Done."
echo "Getting the list of video files from the $VIDEOWALL_DIR directory..."
find $VIDEOWALL_DIR -type f -exec file -N -i -- {} + | grep video | cut --delimiter=":" --fields=1 | sort >> $LIST_FILE
echo "Done."

echo "The list of video wallpapers is stored in $LIST_FILE"
27 changes: 27 additions & 0 deletions video-wall-select.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Script to select a video wallpaper downloaded from the Wallpaper Engine Steam Workshop
# and set it as the current wallpaper with mpvpaper.
# Requires: mpvpaper, file, grep, cut
#
# Usage: select-video-wallpaper.sh
# Author: wizzdom

# dmenu to use
DMENU="wofi --dmenu"

# default video wallpaper
DEFAULT="$HOME/Videos/wallpapers/default.mp4"

LIST_FILE="/tmp/video-wallpapers"

SELECTED=$(cat $LIST_FILE | $DMENU -i -p "Select a video wallpaper")

# Set the selected video as default wallpaper
if [ -f "$DEFAULT" ]; then
rm -f "$DEFAULT"
fi

ln -sf "$SELECTED" "$DEFAULT"

# Set the selected video as the current wallpaper
$HOME/scripts/video-wall.sh "$SELECTED"

0 comments on commit 5936fd3

Please sign in to comment.