installer/postinstall.sh
2025-05-18 21:20:57 -06:00

49 lines
1,016 B
Bash

#!/bin/sh
software="https://git.amolinae.com/amolinae06/installer/raw/branch/main/devware.csv"
apk_install(){
echo "installing $1"; bwroot apk add "$1" >/dev/null 2>&1
}
read_software(){
([ -f "$1" ] && cp "$1" /tmp/temp.csv) || wget -qO- "$1" > /tmp/temp.csv
tail -n +2 "/tmp/temp.csv" | sed -E ':a; s/("[^"]*),([^"]*")/\1\2/; ta' | while IFS=',' read -r NAME DESCRIPTION GIT GIT_URL; do
case "$GIT" in
"D") apk_install $NAME ;;
*) echo "ERROR: failed to determine $NAME."; exit 1 ;;
esac
done
rm "/tmp/temp.csv"
printf "Successfully installed all software!\n"
}
make_dwl() {
cd $HOME/.local/src/dwl/
bwroot make install
}
make_slstatus() {
cd $HOME/.local/src/slstatus/
bwroot make install
}
make_ctpv() {
cd $HOME/.local/src/hellwal/
bwroot make install
}
make_hellwal() {
cd $HOME/.local/src/hellwal/
bwroot make install
cd; wal -i Pictures/Wallpapers/vatihall.jpg
}
cd "/home/$@/"
read_software $software
make_hellwal
make_dwl
make_slstatus
make_ctpv