From 4fa84d27e728631621e25ca000b8b021ec5b5bbb Mon Sep 17 00:00:00 2001 From: Jeremie Fraeys Date: Tue, 19 Dec 2023 17:13:32 -0500 Subject: [PATCH] changed setup.sh to install firefox configs --- setup.sh | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/setup.sh b/setup.sh index c9c4c6c..621183e 100755 --- a/setup.sh +++ b/setup.sh @@ -25,6 +25,11 @@ useronly_macos=( skhd ) +#Folders that should, or only need to be installed for a local user on Linux +useronly_linux=( + i3 +) + # Folders that should, or only need to be installed for a local user useronly=( conda @@ -61,6 +66,10 @@ is_macos() { [[ "$(uname)" == "Darwin" ]] } +is_linux() { + [[ "$(uname)" == "Linux" ]] +} + # Function to automate firefox profile updater with expect expect_yes() { profile_dir=$(find ~/Library/Application\ Support/Firefox/Profiles -type d -name '*.default-release' -print -quit) @@ -71,15 +80,18 @@ expect_yes() { fi expect -c " - set timeout 3 - spawn bash -c \"cd '$profile_dir' && $1\" + set timeout 1 + log_user 0 + spawn bash -c \"cd '$profile_dir' && $1\" > /dev/null 2>&1 expect { \"This script will update to the latest user.js file and append any custom configurations from user-overrides.js. Continue Y/N?\" { send \"y\r\"; exp_continue } - eof { exit } + eof { + puts \"Error: Expected line not found.\" + exit 1 + } } " } - echo "" echo "Stowing apps for user: ${USER}" @@ -97,6 +109,14 @@ if is_macos; then done fi +if is_linux; then + for app in "${useronly[@]}"; do + if [ "$(id -u)" -ne 0 ]; then + stowit "${HOME}" "${app}" + fi + done +fi + # Install useronly folders for app in "${useronly[@]}"; do if [ "$(id -u)" -ne 0 ]; then