Make updating firefox config optional

This commit is contained in:
RealStickman 2023-05-22 21:16:01 +02:00
parent 6a0dfeba25
commit 1bde1df151

View File

@ -76,14 +76,19 @@ fi
#### Arguments #### #### Arguments ####
#################### ####################
copy_firefox=0
# handle arguments # handle arguments
if [[ "$#" -eq 1 ]]; then if [[ "$#" -eq 1 ]]; then
# -t/--theme to change theme # -t/--theme to change theme
if [[ "$1" == "-t" || "$1" == "--theme" ]]; then if [[ "$1" == "-t" || "$1" == "--theme" ]]; then
func_seltheme func_seltheme
elif [[ "$1" == "-f" || "$1" == "--firefox" ]]; then
copy_firefox=1
elif [[ "$1" == "-h" || "$1" == "--help" ]]; then elif [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo "-h, --help Show help menu" echo "-h, --help Show help menu"
echo "-t, --theme Show theme selection screen" echo "-t, --theme Show theme selection screen"
echo "-f, --firefox Update firefox config"
fi fi
elif [[ "$#" -gt 1 ]]; then elif [[ "$#" -gt 1 ]]; then
echo "Too many arguments" echo "Too many arguments"
@ -229,6 +234,9 @@ cp -r ~/configs/arch-config/.local/ ~/
#cp -r ~/config/.elvish ~/ #cp -r ~/config/.elvish ~/
cp -r ~/configs/arch-config/.doom.d ~/ cp -r ~/configs/arch-config/.doom.d ~/
cp -r ~/configs/arch-config/.ssh ~/ cp -r ~/configs/arch-config/.ssh ~/
# copy firefox only if "-f" or "--firefox" is given as argument
if [[ copy_firefox -eq 1 ]]; then
if [[ -d ~/.mozilla/firefox ]]; then if [[ -d ~/.mozilla/firefox ]]; then
# NOTE check if firefox default-release directory exists. 1 is good, 0 is bad # NOTE check if firefox default-release directory exists. 1 is good, 0 is bad
firefoxdir=$(find ~/.mozilla/firefox/ -name \*.default-release | wc -l) firefoxdir=$(find ~/.mozilla/firefox/ -name \*.default-release | wc -l)
@ -240,6 +248,8 @@ if [[ -d ~/.mozilla/firefox ]]; then
else else
echo "Please launch firefox and then update the config again" echo "Please launch firefox and then update the config again"
fi fi
fi
echo Copied folders echo Copied folders
#copy single files #copy single files