From 135ace00d0b6f0f23cd13e09942103e7851b52ee Mon Sep 17 00:00:00 2001 From: RealStickman Date: Sun, 21 May 2023 16:08:00 +0200 Subject: [PATCH] Modify install script to be less hands-on --- README.md | 17 ++++++++++ arch-setup/install.sh | 49 +++++++++++++++++----------- arch-setup/packages/officialpkgs.txt | 3 ++ arch-setup/packages/sort-lists.sh | 7 ++-- 4 files changed, 53 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 25102848..14456b4c 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,26 @@ All my config files, scripts and other in one place. Mostly focused on ArchLinux, although there is also a NixOS configuration and independent Python programs. +## ArchLinux + - [arch-config](./arch-config) - [arch-setup](./arch-setup) - [arch-themes](./arch-themes) + +### First time installation + +Enable the `multilib` repository in `/etc/pacman.conf` + +```sh +git clone https://gitea.exu.li/realstickman/configs.git +cd configs/arch-setup +./install.sh +``` + +### Config updates + +## Other + - [easyffmpeg](./easyffmpeg) - [music-normalize](./music-normalize) - [nixos-config](./nixos-config) diff --git a/arch-setup/install.sh b/arch-setup/install.sh index f299d89a..01574439 100755 --- a/arch-setup/install.sh +++ b/arch-setup/install.sh @@ -16,9 +16,22 @@ if ! pacman -Sl multilib &>/dev/null; then exit 1 fi +# NOTE on unattended pacman installing +# Option 1: Will assume the default choice +#--noconfirm +# Option 2: Will always choose "yes", locale override needed to work all the time (might fail for other locales) +#yes | LC_ALL=en_US.UTF-8 pacman ... +# +# excpect & send + # fix install problems -sudo pacman -Syu -sudo pacman -S --needed python-pip +echo Updating keyring +sudo pacman -Sy --noconfirm archlinux-keyring +echo Updating repos and packages +sudo pacman -Syu --noconfirm +echo Installing pip +sudo pacman -S --needed --noconfirm python-pip +echo Select packages to install cmd=(dialog --separate-output --checklist "Select Desktop environment/Window manager:" 22 76 16) options=(0 "[DE] xfce4" off # any option can be set to default to "on" @@ -213,20 +226,12 @@ done #uninstalling unused packages echo Uninstalling unused packages -sudo pacman -Rns - <"$setupdir/packages/uninstall.txt" +sudo pacman -Rns --noconfirm - <"$setupdir/packages/uninstall.txt" echo Uninstalled unused packages -# find all repos -sudo pacman -Sy - -#update stuff -echo Updating packages -sudo pacman -Syu -echo Updated packages - #pacman programs echo Installing default pacman programs -sudo pacman -S --needed - <"$setupdir/packages/officialpkgs.txt" +sudo pacman -S --needed --noconfirm - <"$setupdir/packages/officialpkgs.txt" echo Installed official programs # install paru-bin with yay, or download paru from github @@ -243,7 +248,7 @@ fi # audio echo Installing audio programs -paru -S --needed - <"$setupdir/packages/audiopkgs.txt" +paru -S --needed --noconfirm - <"$setupdir/packages/audiopkgs.txt" echo Installed audio programs #AUR @@ -253,12 +258,12 @@ echo Installed AUR programs # theming echo Installing themes and icons -paru -S --needed - <"$setupdir/packages/theme-packages.txt" +paru -S --needed --noconfirm - <"$setupdir/packages/theme-packages.txt" echo Installed themes and icons #install wine echo Installing wine -sudo pacman -S --needed - <"$setupdir/packages/winepkgs.txt" +sudo pacman -S --noconfirm --needed - <"$setupdir/packages/winepkgs.txt" echo Installed wine ################### @@ -267,12 +272,18 @@ echo Installed wine echo Installing selected programs # install selected packages -echo Installing from official repository -sudo pacman -S --needed - <"$setupdir/selectedpkgs.txt" +if [ -f "$setupdir/selectedpkgs.txt" ]; then + echo Installing from official repository + # NOTE || true to continue if no packages have been selected + sudo pacman -S --needed --noconfirm - <"$setupdir/selectedpkgs.txt" || true +fi # install selected aur packages -echo Installing from AUR -paru -S --needed - <"$setupdir/aurselectedpkgs.txt" +if [ -f "$setupdir/aurselectedpkgs.txt" ]; then + echo Installing from AUR + # NOTE || true to continue if no packages have been selected + paru -S --needed --noconfirm - <"$setupdir/aurselectedpkgs.txt" || true +fi #devtools if [ $in_doomemacs -eq 1 ]; then diff --git a/arch-setup/packages/officialpkgs.txt b/arch-setup/packages/officialpkgs.txt index 2d1f7d6b..e9ab3d66 100644 --- a/arch-setup/packages/officialpkgs.txt +++ b/arch-setup/packages/officialpkgs.txt @@ -83,8 +83,10 @@ os-prober os-prober p7zip pacman-contrib +phonon-qt5-gstreamer picom piper +pipewire-jack playerctl polkit-gnome python-dbus @@ -119,6 +121,7 @@ webkit2gtk wget whois wireguard-tools +wireplumber xdg-user-dirs xdotool xf86-input-elographics diff --git a/arch-setup/packages/sort-lists.sh b/arch-setup/packages/sort-lists.sh index f15e1353..d5b207a1 100755 --- a/arch-setup/packages/sort-lists.sh +++ b/arch-setup/packages/sort-lists.sh @@ -1,12 +1,11 @@ #!/usr/bin/env bash set -euo pipefail -cd "$HOME/GitProjects/setup/packages/" +cd "$HOME/GitProjects/configs/arch-setup/packages/" - -readarray -d '' packagefiles < <(find "$HOME/GitProjects/setup/packages/" -name "*\.txt" -print0) +readarray -d '' packagefiles < <(find "$HOME/GitProjects/configs/arch-setup/packages/" -name "*\.txt" -print0) for file in "${packagefiles[@]}"; do echo "Sorting $file" - cat "$file" | sort > "${file}.tmp" && mv "${file}.tmp" "$file" + cat "$file" | sort >"${file}.tmp" && mv "${file}.tmp" "$file" done