diff --git a/.install/wallpaper.sh b/.install/wallpaper.sh index 8fad4f7..6af9496 100644 --- a/.install/wallpaper.sh +++ b/.install/wallpaper.sh @@ -33,10 +33,21 @@ fi echo "" # ------------------------------------------------------ -# Copy default wallpaper to .cache +# Copy default wallpaper files to .cache # ------------------------------------------------------ -if [ ! -f ~/.cache/current_wallpaper.jpg ]; then - cp wallpapers/default.jpg ~/.cache/current_wallpaper.jpg - echo "Default wallpaper installed." - echo "" + +# Cache file for holding the current wallpaper +cache_file="$HOME/.cache/current_wallpaper" +rasi_file="$HOME/.cache/current_wallpaper.rasi" + +# Create cache file if not exists +if [ ! -f $cache_file ] ;then + touch $cache_file + echo "$HOME/wallpaper/default.jpg" > "$cache_file" +fi + +# Create rasi file if not exists +if [ ! -f $rasi_file ] ;then + touch $rasi_file + echo "* { current-image: url(\"$HOME/wallpaper/default.jpg\", height); }" > "$rasi_file" fi