From ab9dc96d44d4c0f0cf9f7dc9714bd11ce871439b Mon Sep 17 00:00:00 2001 From: exu Date: Sat, 18 May 2024 09:23:30 +0200 Subject: [PATCH] Update background image path and implement error handling --- arch-config/scripts/arch-config.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch-config/scripts/arch-config.sh b/arch-config/scripts/arch-config.sh index b9bed50a..9df18b09 100755 --- a/arch-config/scripts/arch-config.sh +++ b/arch-config/scripts/arch-config.sh @@ -329,11 +329,15 @@ fi # chmod +x ~/.fehbg # copy chosen image for lockscreen and desktop -backgroundimage="/home/exu/Bilder/Backgrounds/artstation/dk-lan/artstation_14224733_55806391_月半与鬼哭.jpg" +backgroundimage="/home/exu/Bilder/Art/artstation/dk-lan/artstation_14224733_55806391_月半与鬼哭.jpg" mkdir -p "$HOME/.cache/backgrounds" -cp "$backgroundimage" "$HOME/.cache/backgrounds/desktop" -cp "$backgroundimage" "$HOME/.cache/backgrounds/lockscreen" +if [ -f "$backgroundimage" ]; then + cp "$backgroundimage" "$HOME/.cache/backgrounds/desktop" + cp "$backgroundimage" "$HOME/.cache/backgrounds/lockscreen" +else + printf "\033[38;2;200;20;20mCouldn't find background image\n\033[0m" +fi chmod +x "$HOME/scripts/gsettings.sh" bash "$HOME/scripts/gsettings.sh"