diff --git a/.vimrc b/.vimrc index 79ea257..c2cf436 100644 --- a/.vimrc +++ b/.vimrc @@ -109,7 +109,11 @@ endif set termguicolors set background=dark " or light " colorscheme solarized -colorscheme darcula + +" Check if the color scheme file is available before applying it +if exists("g:plugs['darcula']") && filereadable(expand("~/.vim/plugged/darcula/colors/darcula.vim")) + colorscheme darcula +endif hi Visual term=reverse cterm=reverse guibg=Grey diff --git a/README.org b/README.org index 6c5e214..2fef007 100644 --- a/README.org +++ b/README.org @@ -14,14 +14,17 @@ alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' config config --local status.showUntrackedFiles no config checkout - zsh source ~/.proxies - sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + 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 + vim +PlugInstall +qall + + zsh + # run tmux, prefix + I installs all plugins (needs to have proxies set) # run vim, :PlugInstall diff --git a/bootstrap.sh b/bootstrap.sh new file mode 100755 index 0000000..33af070 --- /dev/null +++ b/bootstrap.sh @@ -0,0 +1,72 @@ +#!/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: