Preparing for archlinux

This commit is contained in:
2025-05-02 22:07:00 +02:00
parent 8d1a0e9557
commit 178ba8ae8f
3 changed files with 67 additions and 3 deletions
+42 -3
View File
@@ -51,6 +51,8 @@ yes_no_ask() {
fi
}
has_apt=0
has_pacman=0
should_install_git=0
should_install_zsh=0
should_install_dotfiles=0
@@ -61,6 +63,25 @@ should_install_nodejs=0
should_install_python=0
should_install_hyrpland=0
find_os() {
apt --version > /dev/null 2>&1
if [ $? -eq 0 ]; then
has_apt=1
return
fi
pacman --version > /dev/null 2>&1
if [ $? -eq 0 ]; then
has_pacman=1
return
fi
error_n "os not supported"
exit 1
}
ask_for_dotfiles() {
yes_no_ask "do you wish to install and configure dotfiles?"
if [ $? -ne 0 ]; then
@@ -135,6 +156,11 @@ ask_for_nodejs() {
}
ask_for_hyprland() {
if [ $has_pacman -ne 1 ]; then
warn_n "tforgione's installer does not support this os for setting up hyprland"
return
fi
yes_no_ask "do you wish to install and configure hyprland?"
if [ $? -ne 0 ]; then
@@ -179,7 +205,7 @@ debug() {
}
run() {
packages=()
packags=()
python_packages=()
if [ $should_install_git -eq 1 ]; then
@@ -206,7 +232,14 @@ run() {
fi
if [ $should_install_python ]; then
packages+=(python)
if [ $has_apt -eq 1 ]; then
packages+=(python3)
packages+=(python-is-python3)
packages+=(python3-pip)
elif [ $has_pacman ]; then
packages+=(python)
fi
fi
if [ $should_instlal_hyprland -eq 1 ]; then
@@ -223,7 +256,12 @@ run() {
python_packages+=(psutil)
fi
sudo apt install -y ${packages[@]}
if [ $has_apt -eq 1 ]; then
sudo apt install -y ${packages[@]}
elif [ $has_pacman -eq 1 ]; then
sudo pacman -Sy ${packages[@]} --noconfirm
fi
if [ $should_install_dotfiles -eq 1 ]; then
if [ ! -d $HOME/.config/ohmyzsh ]; then
@@ -295,6 +333,7 @@ banner() {
main() {
banner
find_os
info "before anything, i need to know if your user can use sudo"
yes_no_ask "can your user use sudo?"