From 63f2f458666a80829eb674a26bdd6dad85adb180 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Mon, 3 Feb 2025 11:52:58 +0900 Subject: [PATCH] This is it.. I can feel it... danggit --- install-scripts/thunar.sh | 41 +++++++++++++++++++++++---------------- preset.sh | 2 +- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/install-scripts/thunar.sh b/install-scripts/thunar.sh index cf50acf..0902976 100755 --- a/install-scripts/thunar.sh +++ b/install-scripts/thunar.sh @@ -38,24 +38,31 @@ printf "${NOTE} Installing ${SKY_BLUE}Thunar${RESET} Packages...\n\n" printf "\n%.0s" {1..2} -# confirm if wanted to set as default +if [[ $USE_PRESET = [Yy] ]]; then + source ./preset.sh +fi + +# Confirm if wanted to set as default while true; do - read -n 1 -r -p "${CAT} set ${MAGENTA}Thunar${RESET} as the default file manager? (y/n)" thundefault - case $thundefault in - [Yy]) - xdg-mime default thunar.desktop inode/directory - xdg-mime default thunar.desktop application/x-wayland-gnome-saved-search - echo "${OK} Thunar has been set as the default file manager." | tee -a "$LOG" - break - ;; - [Nn]) - echo "${NOTE} you chose not to set Thunar as the default file manager." | tee -a "$LOG" - break - ;; - *) - echo "Invalid input. Please enter 'y' or 'n'." - ;; - esac + if [[ -z $thunar_choice ]]; then + read -p "${CAT} want to set ${MAGENTA}Thunar${RESET} as the default file manager? (y/n): " thunar_choice + fi + case "$thunar_choice" in + [Yy]*) + xdg-mime default thunar.desktop inode/directory + xdg-mime default thunar.desktop application/x-wayland-gnome-saved-search + echo "${OK} Thunar has been set as the default file manager." | tee -a "$LOG" + break + ;; + [Nn]*) + echo "${NOTE} You chose not to set ${MAGENTA}Thunar${RESET} as the default file manager." | tee -a "$LOG" + break + ;; + *) + echo "${WARN} Invalid input. Please enter 'y' or 'n'." + unset thunar_choice + ;; + esac done printf "\n%.0s" {1..1} diff --git a/preset.sh b/preset.sh index e810a19..e30e992 100644 --- a/preset.sh +++ b/preset.sh @@ -34,7 +34,7 @@ dots="Y" ### Would you like to blacklist nouveau? (y/n) blacklist_nouveau="Y" ### Do you want to set Thunar as the default file manager? (y/n): " -thundefault="Y" +thunar_choice="Y" ### OPTIONAL - Would you like to install SDDM themes? (y/n) install_sddm_theme="Y" ### " This script will add your user to the 'input' group."