#!/bin/bash

ICON="/usr/share/icons/hicolor/48x48/apps/random-background.png"
DIR=$HOME/'Wallpapers'
PIC=$(ls $DIR/*.* | shuf -n1)
/usr/bin/plasma-apply-wallpaperimage "$PIC"
echo "'$PIC'"| awk 'NR==1{print $0}' > $HOME/.random-background/wallpaper_data_0
if [[ "$PIC" == "" ]]; then
$(yad --width=400 --height=100 \
	--fixed --center --text="<b>No found images in Wallpapers folder</b>\n\nAdd some images to ~/Wallpapers." \
    --window-icon=$ICON --image=$ICON --title="Random Background" \
	--button=Cancel!/usr/share/random-background/icons/cancel.png)
exit 0
fi








