#!/bin/bash function install_dependencies() { sudo -n apt-get update sudo -n DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ fish \ neovim \ tmux } function setup_ssh() { mkdir -p ~/.ssh touch ~/.ssh/config chmod 644 ~/.ssh/config cat << EOF >> ~/.ssh/config Include ${HOME}/dotfiles/ssh.config EOF } function setup_git() { cat << EOF > ~/.gitconfig [include] path = ${HOME}/dotfiles/git/gitconfig [core] excludesfile = ${HOME}/dotfiles/git/gitignore_global EOF setup_ssh } function setup_tmux() { cat << EOF > ~/.tmux.conf source ${HOME}/dotfiles/tmux/tmux.conf EOF } function setup_fish() { USER=`whoami` sudo -n chsh $USER -s $(which fish) # Force fish shell for devcontainers echo "exec $(which fish) -l" >> ~/.profile echo "exec $(which fish) -l" >> ~/.bashrc echo "exec $(which fish) -l" >> ~/.zshrc mkdir -p ~/.config/ ln -s ~/dotfiles/fish ~/.config/fish } function setup_nvim() { mkdir -p ~/.config/nvim/ ln -s ~/dotfiles/init.vim ~/.config/nvim/init.vim } function main() { if [[ ${REMOTE_CONTAINERS} || ${DEVCONTAINER} ]]; then echo "INSTALLING IN DEVCONTAINER" fi install_dependencies echo "sv_SE.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen sudo locale-gen setup_fish setup_ssh setup_git setup_tmux setup_nvim } main $@