From 379087dac10d7823225b7ea56e8b9977c69ba4c9 Mon Sep 17 00:00:00 2001 From: Stephan Raabe Date: Thu, 21 Dec 2023 22:10:14 +0100 Subject: [PATCH] Updates --- .install/wallpaper.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) 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