Hyprland-dotfiles/.install/wallpaper.sh

55 lines
1.9 KiB
Bash
Raw Permalink Normal View History

2023-11-10 16:12:15 -05:00
# ------------------------------------------------------
# Install wallpapers
# ------------------------------------------------------
2023-11-17 07:48:02 -05:00
echo -e "${GREEN}"
2023-12-21 15:57:44 -05:00
figlet "Wallpapers"
2023-11-17 07:48:02 -05:00
echo -e "${NONE}"
if [ ! -d ~/wallpaper ]; then
2024-05-22 00:19:43 -04:00
echo "Do you want to download the wallpapers from repository https://gitea.phywyj.dynv6.net/wyj/wallpaper.git ?"
2023-11-20 16:24:53 -05:00
echo "If not, the script will install 3 default wallpapers in ~/wallpaper/"
echo ""
if gum confirm "Do you want to download the repository?" ;then
2024-05-22 00:19:43 -04:00
# wget -P ~/Downloads/ https://gitlab.com/stephan-raabe/wallpaper/-/archive/main/wallpaper-main.zip
# unzip -o ~/Downloads/wallpaper-main.zip -d ~/Downloads/
# if [ ! -d ~/wallpaper/ ]; then
# mkdir ~/wallpaper
# fi
# cp ~/Downloads/wallpaper-main/* ~/wallpaper/
git clone https://gitea.phywyj.dynv6.net/wyj/wallpaper.git ~/wallpaper
2023-12-10 07:37:48 -05:00
echo "Wallpapers from the repository installed successfully."
2023-11-21 15:19:51 -05:00
elif [ $? -eq 130 ]; then
exit 130
2023-11-20 16:24:53 -05:00
else
if [ -d ~/wallpaper/ ]; then
echo "wallpaper folder already exists."
else
mkdir ~/wallpaper
fi
cp wallpapers/* ~/wallpaper
echo "Default wallpapers installed successfully."
fi
2023-11-17 07:48:02 -05:00
else
2024-01-25 14:55:32 -05:00
echo ":: ~/wallpaper folder already exists."
2023-11-17 07:48:02 -05:00
fi
2023-11-10 16:12:15 -05:00
echo ""
# ------------------------------------------------------
2023-12-21 16:10:14 -05:00
# Copy default wallpaper files to .cache
2023-11-10 16:12:15 -05:00
# ------------------------------------------------------
2023-12-21 16:10:14 -05:00
# 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"
2023-11-17 07:48:02 -05:00
fi