my-scripts/installers/arch/scripts/aur-install.sh

48 lines
849 B
Bash
Raw Normal View History

2022-10-01 22:59:41 +00:00
#!/bin/sh
AUR_PROGS_FILE="$1"
2022-11-19 19:20:55 +00:00
YAY_INSTALL_DIR="$HOME/.local/src/yay"
2022-10-01 22:59:41 +00:00
yay_install() {
sudo pacman -S base-devel fakeroot
mkdir -p "$YAY_INSTALL_DIR"
git clone https://aur.archlinux.org/yay.git "$YAY_INSTALL_DIR"
cd "$YAY_INSTALL_DIR"
makepkg -si
}
2022-10-01 22:59:41 +00:00
2023-01-08 02:16:01 +00:00
greetd_config() {
sudo mkdir -p /etc/greetd/
GREETD_CONFIG="[terminal]
vt = 1
[default_session]
command = \"tuigreet --time --cmd sway\"
user = \"greeter\""
sudo sh -c "echo $GREETD_CONFIG > /etc/greetd/config.toml"
}
pkg_install() {
aurprogs="$(cat "$AUR_PROGS_FILE")"
for pkg in $aurprogs
do
yay -S "$pkg"
done
}
2022-10-01 22:59:41 +00:00
if [ -f "$AUR_PROGS_FILE" ]; then
2022-10-01 22:59:41 +00:00
! [ -f "/usr/bin/yay" ] && yay_install
2022-10-01 22:59:41 +00:00
pkg_install
2023-01-08 02:16:01 +00:00
else
echo "enter file containing package names to install separated by newlines as first input argument" && exit
fi
2022-10-01 22:59:41 +00:00