#!/usr/bin/env bash check_installed() { packages=("$@") all_installed=true for pkg in "${packages[@]}"; do if ! command -v "$pkg" > /dev/null 2>&1; then all_installed=false break fi done $all_installed && return 0 || return 1 } install_packages() { # List of packages to install packages="zsh git" if [ ! check_installed zsh tmux git ]; then # Determine which package manager is available if check_installed apt; then echo "Using apt to install packages..." sudo apt update sudo apt install -y $packages elif check_installed dnf; then echo "Using dnf to install packages..." sudo dnf install -y $packages elif check_installed yum; then echo "Using yum to install packages..." sudo yum install -y $packages elif check_installed brew; then echo "Using Homebrew to install packages..." brew install $packages else echo "No supported package manager found (apt, dnf, yum, brew)." return 1 fi fi } clone_repos () { git clone --bare https://git.meinlschmidt.org/jetpac/dotfiles.git ~/.cfg cd ~/.cfg git config --local status.showUntrackedFiles no git checkout sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh) --unattended --skip-chsh --keep-zshrc" git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim } configure_vim() { vim +PlugInstall +qall } configure_tmux() { echo "run tmux, prefix + I installs all plugins (needs to have proxies set)" } # Call the function to execute the installation install_packages clone_repos configure_vim configure_tmux # vim: foldmethod=marker:foldmarker={,}:expandtab:sw=4:ts=4: