changed setup.sh to install firefox configs

This commit is contained in:
Jeremie Fraeys 2023-12-19 17:13:32 -05:00
parent abf6dd2854
commit 4fa84d27e7

View file

@ -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