Added Thumbnailing to wallpaper picker
This commit is contained in:
+32
-11
@@ -2,6 +2,10 @@
|
||||
|
||||
# Path to the image is the first argument
|
||||
IMAGE="$1"
|
||||
image_name=$(basename "$IMAGE")
|
||||
image="$HOME/Pictures/Wallpapers/$image_name"
|
||||
|
||||
echo "$image"
|
||||
|
||||
echo "start"
|
||||
|
||||
@@ -11,17 +15,34 @@ if [[ -z "$IMAGE" ]]; then
|
||||
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
|
||||
if [ -x "/usr/bin/swww-daemon" ]; then
|
||||
echo "swww-daemon exists and is executable"
|
||||
|
||||
# Set the wallpaper
|
||||
echo "running"
|
||||
swww img "$IMAGE" -t grow --transition-duration 1
|
||||
# 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
|
||||
|
||||
elif [ -x "/usr/bin/hyprpaper" ]; then
|
||||
echo "hyprpaper exists and is executable"
|
||||
|
||||
if ! pgrep -x "hyprpaper" > /dev/null; then
|
||||
echo "Starting hyprpaper daemon..."
|
||||
hyprpaper &
|
||||
|
||||
# Give the daemon a moment to start
|
||||
sleep 0.2
|
||||
echo "daemon started"
|
||||
fi
|
||||
hyprctl hyprpaper wallpaper ", $image"
|
||||
fi
|
||||
Reference in New Issue
Block a user