28 lines
496 B
Bash
Executable File
28 lines
496 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Path to the image is the first argument
|
|
IMAGE="$1"
|
|
|
|
echo "start"
|
|
|
|
# Check if an image was provided
|
|
if [[ -z "$IMAGE" ]]; then
|
|
echo "Usage: $0 /path/to/image"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if swww daemon is running
|
|
if ! pgrep -x "swww-daemon" > /dev/null; then
|
|
echo "Starting swww daemon..."
|
|
swww-daemon &
|
|
|
|
# Give the daemon a moment to start
|
|
sleep 0.2
|
|
echo "daemon started"
|
|
fi
|
|
|
|
# Set the wallpaper
|
|
echo "running"
|
|
swww img "$IMAGE" -t grow --transition-duration 1
|
|
|