From 725e22ff67e6311a1dea18d698425c0af283fd27 Mon Sep 17 00:00:00 2001 From: Rory Dunne Date: Sat, 7 Sep 2024 11:52:41 -0400 Subject: [PATCH] fix: Correctly Detect Pictures Directory and Clone Path for Background --- tabs/applications-setup/dwmtitus-setup.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tabs/applications-setup/dwmtitus-setup.sh b/tabs/applications-setup/dwmtitus-setup.sh index 8c0fc97a..7d6398b4 100644 --- a/tabs/applications-setup/dwmtitus-setup.sh +++ b/tabs/applications-setup/dwmtitus-setup.sh @@ -142,29 +142,32 @@ clone_config_folders() { } configure_backgrounds() { + # Set the variable PIC_DIR which stores the path for images + PIC_DIR="$HOME/Pictures" + # Set the variable BG_DIR to the path where backgrounds will be stored - BG_DIR="$HOME/Pictures/backgrounds" + BG_DIR="$PIC_DIR/backgrounds" # Check if the ~/Pictures directory exists - if [ ! -d "~/Pictures" ]; then + if [ ! -d "$PIC_DIR" ]; then # If it doesn't exist, print an error message and return with a status of 1 (indicating failure) echo "Pictures directory does not exist" - mkdir ~/Pictures + mkdir "$PIC_DIR" echo "Directory was created in Home folder" fi - + # Check if the backgrounds directory (BG_DIR) exists if [ ! -d "$BG_DIR" ]; then # If the backgrounds directory doesn't exist, attempt to clone a repository containing backgrounds - if ! git clone https://github.com/ChrisTitusTech/nord-background.git ~/Pictures; then + if ! git clone https://github.com/ChrisTitusTech/nord-background.git "$PIC_DIR/nord-background"; then # If the git clone command fails, print an error message and return with a status of 1 echo "Failed to clone the repository" return 1 fi # Rename the cloned directory to 'backgrounds' - mv ~/Pictures/nord-background ~/Pictures/backgrounds + mv "$PIC_DIR/nord-background" "$PIC_DIR/backgrounds" # Print a success message indicating that the backgrounds have been downloaded - echo "Downloaded desktop backgrounds to $BG_DIR" + echo "Downloaded desktop backgrounds to $BG_DIR" else # If the backgrounds directory already exists, print a message indicating that the download is being skipped echo "Path $BG_DIR exists for desktop backgrounds, skipping download of backgrounds" @@ -290,9 +293,6 @@ setupDisplayManager() { echo "Auto-login configuration skipped" fi fi - - - } checkEnv