diff --git a/README.md b/README.md index e0ce74c..c1a6dd1 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,3 @@ -# dotfiles +# .dotfiles -My dotfiles (configurations and settings) for shells, text editors and other terminal programs, plus a collection of scripts. Written for and work on various UNIX-like OSes, primarily for: - -- Arch Linux, -- Linux Mint, -- server Ubuntu, -- macOS with GNU coreutils (i.e. BSDs are not supported), -- Android with Termux. - -And also a legendary project that has survived for thousands of years of development. - -## Disclaimer - -### **This is my personal project! No warranty is provided for running these as a superuser, I am in no way responsible for deletion of `/` with `rm -rf`, and _absolutely no support is provided_ whatsoever unless I explicitly say so personally!** - -**It is also recommended for users of this repository to read the scripts they are running. I didn't write the comments just for myself!** - -**Automatic installers are deliberately not provided.** +My dotfiles for macOS, Arch Linux, Raspbian and Android (Termux). diff --git a/install.zsh b/install.zsh new file mode 100755 index 0000000..f816480 --- /dev/null +++ b/install.zsh @@ -0,0 +1,38 @@ +#!/usr/bin/env zsh + +DOTFILES_PATH="${0:a:h}" + +install_dotfile() { + local dest="$1" + local contents="$2" + + if [[ -f "$dest" ]]; then + mv -vi "$dest" "$dest.dmitmel-dotfiles-backup" + fi + + mkdir -pv "${dest:h}" + print -r -- "installing dotfile '$dest'" + print -r -- "$contents" > "$dest" +} + +# ZSH +for file_name in zshrc; do + file_path="$DOTFILES_PATH/zsh/$file_name" + install_dotfile "$HOME/.$file_name" "source ${(q)file_path}" +done + +# Neovim +for file_name in {init,ginit}.vim; do + file_path="$DOTFILES_PATH/nvim/$file_name" + install_dotfile "$HOME/.config/nvim/$file_name" "source ${(q)file_path}" +done + +# Kitty +file_name=kitty.conf +file_path="$DOTFILES_PATH/kitty/$file_name" +install_dotfile "$HOME/.config/kitty/$file_name" "include ${(q)file_path}" + +# tmux +file_name=tmux.conf +file_path="$DOTFILES_PATH/tmux/$file_name" +install_dotfile "$HOME/.$file_name" "source-file ${(q)file_path}" diff --git a/upgrade.zsh b/upgrade.zsh new file mode 100755 index 0000000..81b28b3 --- /dev/null +++ b/upgrade.zsh @@ -0,0 +1,14 @@ +#!/usr/bin/env zsh + +DOTFILES_PATH="${0:a:h}" +cd "$DOTFILES_PATH" || exit 1 +ZSH_DOTFILES="$DOTFILES_PATH/zsh" + +source "$ZSH_DOTFILES/functions.zsh" + +git pull --rebase --stat origin master +git submodule update --init --recursive --remote --progress + +ZPLG_SKIP_LOADING=1 +source "$ZSH_DOTFILES/plugins.zsh" +zplg-upgrade