summaryrefslogtreecommitdiff
path: root/archsetup
diff options
context:
space:
mode:
Diffstat (limited to 'archsetup')
-rwxr-xr-xarchsetup41
1 files changed, 29 insertions, 12 deletions
diff --git a/archsetup b/archsetup
index 65c1f75..5b43988 100755
--- a/archsetup
+++ b/archsetup
@@ -18,6 +18,14 @@
# uncomment to stop on any error
# set -e
+### Root Check
+
+if [ "$EUID" -ne 0 ]; then
+ echo "ERROR: This script must be run as root"
+ echo "Usage: sudo $0"
+ exit 1
+fi
+
### Parse Arguments
skip_slow_packages=false
@@ -144,9 +152,11 @@ git_install() {
display "task" "$action"
if ! (sudo -u "$username" git clone --depth 1 "$1" "$build_dir" >> "$logfile" 2>&1); then
- error "error" "cloning source code for $prog_name" "$?"
- (cd "$build_dir" && sudo -u "$username" git pull --force origin master >> "$logfile" 2>&1) || \
- error "error" "pulling source code for $prog_name" "$?"
+ error "error" "cloning source code for $prog_name - directory may exist, removing and retrying" "$?"
+ (rm -rf "$build_dir" >> "$logfile" 2>&1) || \
+ error "error" "removing existing directory for $prog_name" "$?"
+ (sudo -u "$username" git clone --depth 1 "$1" "$build_dir" >> "$logfile" 2>&1) || \
+ error "crash" "re-cloning source code for $prog_name after cleanup" "$?"
fi
(cd "$build_dir" && make install >> "$logfile" 2>&1) || \
@@ -156,11 +166,11 @@ git_install() {
# AUR Install
aur_install() {
action="installing $1 via the AUR" && display "task" "$action"
- if ! (sudo -u "$username" yay -S --noconfirm "$1" >> "$logfile" 2>&1); then
+ if ! (sudo -u "$username" yay -S --noconfirm --nodebug "$1" >> "$logfile" 2>&1); then
action="retrying $1" && display "task" "$action"
- if ! (sudo -u "$username" yay -S --noconfirm "$1" >> "$logfile" 2>&1); then
+ if ! (sudo -u "$username" yay -S --noconfirm --nodebug "$1" >> "$logfile" 2>&1); then
action="retrying $1 once more" && display "task" "$action"
- (sudo -u "$username" yay -S --noconfirm "$1" >> "$logfile" 2>&1) ||
+ (sudo -u "$username" yay -S --noconfirm --nodebug "$1" >> "$logfile" 2>&1) ||
error "error" "$action" "$?"
fi
fi
@@ -354,9 +364,11 @@ aur_installer () {
display "task" "fetching source code for yay"
if ! (sudo -u "$username" git clone --depth 1 "$yay_repo" "$build_dir" >> "$logfile" 2>&1); then
- error "error" "cloning source code for yay"
- (cd "$build_dir" && sudo -u "$username" git pull --force origin master >> "$logfile" 2>&1) || \
- error "crash" "changing directories to $build_dir and pulling source code" "$?"
+ error "error" "cloning source code for yay - directory may exist, removing and retrying"
+ (rm -rf "$build_dir" >> "$logfile" 2>&1) || \
+ error "crash" "removing existing directory for yay" "$?"
+ (sudo -u "$username" git clone --depth 1 "$yay_repo" "$build_dir" >> "$logfile" 2>&1) || \
+ error "crash" "re-cloning source code for yay after cleanup" "$?"
fi
action="packaging and installing yay"; display "task" "$action"
@@ -453,6 +465,10 @@ essential_services() {
systemctl disable systemd-resolved.service >> "$logfile" 2>&1 || error "error" "$action" "$?"
systemctl enable avahi-daemon.service >> "$logfile" 2>&1 || error "error" "$action" "$?"
+ pacman_install geoclue # geolocation service for location-aware apps
+ action="enabling geoclue geolocation service" && display "task" "$action"
+ systemctl enable geoclue.service >> "$logfile" 2>&1 || error "error" "$action" "$?"
+
# Job Scheduling
display "subtitle" "Job Scheduling"
@@ -685,7 +701,6 @@ desktop_environment() {
papirus-icon-theme qt6ct qt5ct; do
aur_install $software
done;
- # adwaita-color-schemes disabled - TODO: fix CMake build issue
pacman_install libappindicator-gtk3 # required by some applets
@@ -921,7 +936,6 @@ supplemental_software() {
pacman_install zlib # compression library
# aur installs
- # aur_install anki # flashcards / drill tool (DISABLED: hangs for 98+ minutes, missing .gitconfig during cargo build)
aur_install dtrx # extraction tool
aur_install figlet-fonts # fonts for figlet
aur_install foliate # pretty epub reader
@@ -942,7 +956,7 @@ supplemental_software() {
# working around an temp integ issue with python-lyricsgenius expiration date
action="prep to workaround tidal-dl issue" && display "task" "$action"
- yay -S --noconfirm --mflags --skipinteg python-lyricsgenius >> "$logfile" 2>&1 || error "error" "$action" "$?"
+ yay -S --noconfirm --nodebug --mflags --skipinteg python-lyricsgenius >> "$logfile" 2>&1 || error "error" "$action" "$?"
aur_install tidal-dl # tidal-dl:tidal as yt-dlp:youtube
}
@@ -1025,6 +1039,9 @@ outro() {
printf "Packages installed : %s\n" "$new_packages"
printf "\n"
printf "Please reboot before working with your new workstation.\n\n"
+
+ # Completion marker for automated testing
+ printf "=== ARCHSETUP_EXECUTION_COMPLETE ===\n" | tee -a "$logfile"
}
### Installation Steps