| 1 | #!/usr/bin/env bash |
| 2 | # |
| 3 | # aurora installer (krolyxon's desktop) |
| 4 | # |
| 5 | # READ THIS FIRST: |
| 6 | # This sets up MY personal desktop (Arch + Hyprland + aurora), built around my own |
| 7 | # hardware (Lenovo Legion, Intel + NVIDIA hybrid, linux-zen) and my habits. |
| 8 | # It is NOT a general purpose installer and I'm not trying to make it one. |
| 9 | # |
| 10 | # Only run it on a FRESHLY INSTALLED, UNCONFIGURED Arch Linux system. |
| 11 | # It installs a lot of packages, moves your existing configs out of the way, |
| 12 | # changes your login shell and can enable system services. |
| 13 | # |
| 14 | # If you just want a piece of the setup, copy the files you like instead. |
| 15 | # |
| 16 | # Usage: |
| 17 | # ./install.sh interactive |
| 18 | # ./install.sh --yes pre-select everything (still asks the fresh-system question) |
| 19 | # ./install.sh --check compare installed packages with packages/*.txt, changes nothing |
| 20 | |
| 21 | trap 'log WARN "Interrupted by user"; exit 130' INT |
| 22 | |
| 23 | INSTALL_STATUS="none" # none | partial | complete | failed |
| 24 | AUTO_YES=0 |
| 25 | CHECK_ONLY=0 |
| 26 | BACKUP_DIR="" |
| 27 | |
| 28 | currentDir="$(dirname "$(readlink -f "$0")")" |
| 29 | cd "$currentDir" || exit 1 |
| 30 | PKG_DIR="$currentDir/packages" |
| 31 | |
| 32 | # shellcheck source=install/lib.sh |
| 33 | source "$currentDir/install/lib.sh" |
| 34 | |
| 35 | ####################### |
| 36 | ## Arguement Parsing ## |
| 37 | ####################### |
| 38 | for arg in "$@"; do |
| 39 | case "$arg" in |
| 40 | --yes|--ci|--non-interactive) |
| 41 | AUTO_YES=1 |
| 42 | ;; |
| 43 | --check) |
| 44 | CHECK_ONLY=1 |
| 45 | ;; |
| 46 | -h|--help) |
| 47 | usage |
| 48 | exit 0 |
| 49 | ;; |
| 50 | *) |
| 51 | log ERROR "Unknown option: $arg" |
| 52 | usage |
| 53 | exit 1 |
| 54 | ;; |
| 55 | esac |
| 56 | done |
| 57 | |
| 58 | if ((CHECK_ONLY)); then |
| 59 | check_packages |
| 60 | exit 0 |
| 61 | fi |
| 62 | |
| 63 | # shellcheck source=install/desktop.sh |
| 64 | source "$currentDir/install/desktop.sh" |