bootstrap script take 1
This commit is contained in:
6
.vimrc
6
.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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
72
bootstrap.sh
Executable file
72
bootstrap.sh
Executable file
@@ -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:
|
||||
Reference in New Issue
Block a user