From 9702f240635e3ed0de0c9c5f0af48669397a0db3 Mon Sep 17 00:00:00 2001 From: Jedrzej Orbik Date: Wed, 25 Sep 2024 02:38:35 +0200 Subject: [PATCH] Install with stow --- .github/workflows/tests.yml | 12 +--- .gitignore | 2 +- .aliases => common/.aliases | 0 {nvim => common/.config/nvim}/init.lua | 0 {nvim => common/.config/nvim}/lazy-lock.json | 2 +- {nvim => common/.config/nvim}/lua/common.lua | 0 .../nvim}/lua/config_plugins/gitsigns.lua | 0 .../nvim}/lua/config_plugins/lsp-zero.lua | 0 .../nvim}/lua/config_plugins/telescope.lua | 0 .../nvim}/lua/config_plugins/treesitter.lua | 0 .../.config/nvim}/lua/debugging.lua | 0 .../.config/nvim}/lua/ftplugin.lua | 0 {nvim => common/.config/nvim}/lua/keymaps.lua | 0 .../template/user/populate_scripts.lua | 0 .../lua/overseer/template/user/run_script.lua | 0 .../template/user/run_script_with_args.lua | 0 {nvim => common/.config/nvim}/lua/p.lua | 0 {nvim => common/.config/nvim}/lua/plugins.lua | 0 .../.config/nvim}/lua/settings.lua | 0 .../.config/nvim}/plugin/filetypes.lua | 0 .../nvim}/snippets/global.code-snippets | 0 .../.config/nvim}/snippets/markdown.json | 0 .../.config/nvim}/snippets/package.json | 0 .../.config/nvim}/snippets/python.json | 0 .../.config/nvim}/snippets/shellscript.json | 0 .p10k.zsh => common/.p10k.zsh | 0 .tmux.conf => common/.tmux.conf | 0 .wezterm.lua => common/.wezterm.lua | 10 ++- debian/clangd | 1 + dotfiles_private | 2 +- install.sh | 53 -------------- macos/.unison/default.prf | 17 +++++ macos/Library/Preferences/clangd | 1 + {clangd => redundant/clangd}/config.yaml | 0 .../debian/install.sh | 4 +- .../debian/install_min.sh | 6 +- scripts/install.sh | 72 +++++++++++++++++++ {macos => scripts/macos}/install.sh | 12 ++-- {macos => scripts/macos}/set_defaults.sh | 3 + set_up_common.sh => scripts/set_up_common.sh | 5 +- scripts/uninstall.sh | 23 ++++++ uninstall.sh | 12 ---- 42 files changed, 144 insertions(+), 93 deletions(-) rename .aliases => common/.aliases (100%) rename {nvim => common/.config/nvim}/init.lua (100%) rename {nvim => common/.config/nvim}/lazy-lock.json (98%) rename {nvim => common/.config/nvim}/lua/common.lua (100%) rename {nvim => common/.config/nvim}/lua/config_plugins/gitsigns.lua (100%) rename {nvim => common/.config/nvim}/lua/config_plugins/lsp-zero.lua (100%) rename {nvim => common/.config/nvim}/lua/config_plugins/telescope.lua (100%) rename {nvim => common/.config/nvim}/lua/config_plugins/treesitter.lua (100%) rename {nvim => common/.config/nvim}/lua/debugging.lua (100%) rename {nvim => common/.config/nvim}/lua/ftplugin.lua (100%) rename {nvim => common/.config/nvim}/lua/keymaps.lua (100%) rename {nvim => common/.config/nvim}/lua/overseer/template/user/populate_scripts.lua (100%) rename {nvim => common/.config/nvim}/lua/overseer/template/user/run_script.lua (100%) rename {nvim => common/.config/nvim}/lua/overseer/template/user/run_script_with_args.lua (100%) rename {nvim => common/.config/nvim}/lua/p.lua (100%) rename {nvim => common/.config/nvim}/lua/plugins.lua (100%) rename {nvim => common/.config/nvim}/lua/settings.lua (100%) rename {nvim => common/.config/nvim}/plugin/filetypes.lua (100%) rename {nvim => common/.config/nvim}/snippets/global.code-snippets (100%) rename {nvim => common/.config/nvim}/snippets/markdown.json (100%) rename {nvim => common/.config/nvim}/snippets/package.json (100%) rename {nvim => common/.config/nvim}/snippets/python.json (100%) rename {nvim => common/.config/nvim}/snippets/shellscript.json (100%) rename .p10k.zsh => common/.p10k.zsh (100%) rename .tmux.conf => common/.tmux.conf (100%) rename .wezterm.lua => common/.wezterm.lua (95%) create mode 120000 debian/clangd delete mode 100755 install.sh create mode 100644 macos/.unison/default.prf create mode 120000 macos/Library/Preferences/clangd rename {clangd => redundant/clangd}/config.yaml (100%) rename set_up_debian_dev.sh => scripts/debian/install.sh (97%) rename set_up_debian.sh => scripts/debian/install_min.sh (98%) create mode 100755 scripts/install.sh rename {macos => scripts/macos}/install.sh (74%) rename {macos => scripts/macos}/set_defaults.sh (96%) rename set_up_common.sh => scripts/set_up_common.sh (93%) create mode 100755 scripts/uninstall.sh delete mode 100755 uninstall.sh diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f101145..7889fed 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,13 +22,7 @@ jobs: token: ${{ secrets.PAT }} submodules: true - - name: Run setup + - name: Test setup run: | - ./install.sh - if [[ "$RUNNER_OS" == "Linux" ]]; then - ./set_up_debian.sh - ./set_up_debian_dev.sh --optional - elif [[ "$RUNNER_OS" == "macOS" ]]; then - ./macos/install.sh - ./macos/set_defaults.sh --optional - fi + ./scripts/install.sh + ./scripts/uninstall.sh diff --git a/.gitignore b/.gitignore index f140c86..66999a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -nvim/lua/machine_settings.lua +common/.config/nvim/lua/machine_settings.lua diff --git a/.aliases b/common/.aliases similarity index 100% rename from .aliases rename to common/.aliases diff --git a/nvim/init.lua b/common/.config/nvim/init.lua similarity index 100% rename from nvim/init.lua rename to common/.config/nvim/init.lua diff --git a/nvim/lazy-lock.json b/common/.config/nvim/lazy-lock.json similarity index 98% rename from nvim/lazy-lock.json rename to common/.config/nvim/lazy-lock.json index 0104043..013d5a1 100644 --- a/nvim/lazy-lock.json +++ b/common/.config/nvim/lazy-lock.json @@ -70,7 +70,7 @@ "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "quicker.nvim": { "branch": "master", "commit": "183041a46d6c908eefb1c23ea02cce9c8f41256e" }, - "render-markdown.nvim": { "branch": "main", "commit": "0986638b381a4b01eb108bb946f3a67a9eb3d0ec" }, + "render-markdown.nvim": { "branch": "main", "commit": "67288febca78b7aac8fae9543ef8980237e27d2a" }, "spaceless.nvim": { "branch": "main", "commit": "8d46bc098dba18d4e19bce89bf19aab5007ef767" }, "stickybuf.nvim": { "branch": "master", "commit": "183b9569bef78f44b17c078214f7d731f19cbefe" }, "substitute.nvim": { "branch": "main", "commit": "17ffaeb5a1dc2dbef39cf0865d8a4b6000836714" }, diff --git a/nvim/lua/common.lua b/common/.config/nvim/lua/common.lua similarity index 100% rename from nvim/lua/common.lua rename to common/.config/nvim/lua/common.lua diff --git a/nvim/lua/config_plugins/gitsigns.lua b/common/.config/nvim/lua/config_plugins/gitsigns.lua similarity index 100% rename from nvim/lua/config_plugins/gitsigns.lua rename to common/.config/nvim/lua/config_plugins/gitsigns.lua diff --git a/nvim/lua/config_plugins/lsp-zero.lua b/common/.config/nvim/lua/config_plugins/lsp-zero.lua similarity index 100% rename from nvim/lua/config_plugins/lsp-zero.lua rename to common/.config/nvim/lua/config_plugins/lsp-zero.lua diff --git a/nvim/lua/config_plugins/telescope.lua b/common/.config/nvim/lua/config_plugins/telescope.lua similarity index 100% rename from nvim/lua/config_plugins/telescope.lua rename to common/.config/nvim/lua/config_plugins/telescope.lua diff --git a/nvim/lua/config_plugins/treesitter.lua b/common/.config/nvim/lua/config_plugins/treesitter.lua similarity index 100% rename from nvim/lua/config_plugins/treesitter.lua rename to common/.config/nvim/lua/config_plugins/treesitter.lua diff --git a/nvim/lua/debugging.lua b/common/.config/nvim/lua/debugging.lua similarity index 100% rename from nvim/lua/debugging.lua rename to common/.config/nvim/lua/debugging.lua diff --git a/nvim/lua/ftplugin.lua b/common/.config/nvim/lua/ftplugin.lua similarity index 100% rename from nvim/lua/ftplugin.lua rename to common/.config/nvim/lua/ftplugin.lua diff --git a/nvim/lua/keymaps.lua b/common/.config/nvim/lua/keymaps.lua similarity index 100% rename from nvim/lua/keymaps.lua rename to common/.config/nvim/lua/keymaps.lua diff --git a/nvim/lua/overseer/template/user/populate_scripts.lua b/common/.config/nvim/lua/overseer/template/user/populate_scripts.lua similarity index 100% rename from nvim/lua/overseer/template/user/populate_scripts.lua rename to common/.config/nvim/lua/overseer/template/user/populate_scripts.lua diff --git a/nvim/lua/overseer/template/user/run_script.lua b/common/.config/nvim/lua/overseer/template/user/run_script.lua similarity index 100% rename from nvim/lua/overseer/template/user/run_script.lua rename to common/.config/nvim/lua/overseer/template/user/run_script.lua diff --git a/nvim/lua/overseer/template/user/run_script_with_args.lua b/common/.config/nvim/lua/overseer/template/user/run_script_with_args.lua similarity index 100% rename from nvim/lua/overseer/template/user/run_script_with_args.lua rename to common/.config/nvim/lua/overseer/template/user/run_script_with_args.lua diff --git a/nvim/lua/p.lua b/common/.config/nvim/lua/p.lua similarity index 100% rename from nvim/lua/p.lua rename to common/.config/nvim/lua/p.lua diff --git a/nvim/lua/plugins.lua b/common/.config/nvim/lua/plugins.lua similarity index 100% rename from nvim/lua/plugins.lua rename to common/.config/nvim/lua/plugins.lua diff --git a/nvim/lua/settings.lua b/common/.config/nvim/lua/settings.lua similarity index 100% rename from nvim/lua/settings.lua rename to common/.config/nvim/lua/settings.lua diff --git a/nvim/plugin/filetypes.lua b/common/.config/nvim/plugin/filetypes.lua similarity index 100% rename from nvim/plugin/filetypes.lua rename to common/.config/nvim/plugin/filetypes.lua diff --git a/nvim/snippets/global.code-snippets b/common/.config/nvim/snippets/global.code-snippets similarity index 100% rename from nvim/snippets/global.code-snippets rename to common/.config/nvim/snippets/global.code-snippets diff --git a/nvim/snippets/markdown.json b/common/.config/nvim/snippets/markdown.json similarity index 100% rename from nvim/snippets/markdown.json rename to common/.config/nvim/snippets/markdown.json diff --git a/nvim/snippets/package.json b/common/.config/nvim/snippets/package.json similarity index 100% rename from nvim/snippets/package.json rename to common/.config/nvim/snippets/package.json diff --git a/nvim/snippets/python.json b/common/.config/nvim/snippets/python.json similarity index 100% rename from nvim/snippets/python.json rename to common/.config/nvim/snippets/python.json diff --git a/nvim/snippets/shellscript.json b/common/.config/nvim/snippets/shellscript.json similarity index 100% rename from nvim/snippets/shellscript.json rename to common/.config/nvim/snippets/shellscript.json diff --git a/.p10k.zsh b/common/.p10k.zsh similarity index 100% rename from .p10k.zsh rename to common/.p10k.zsh diff --git a/.tmux.conf b/common/.tmux.conf similarity index 100% rename from .tmux.conf rename to common/.tmux.conf diff --git a/.wezterm.lua b/common/.wezterm.lua similarity index 95% rename from .wezterm.lua rename to common/.wezterm.lua index bb7850f..32b274a 100644 --- a/.wezterm.lua +++ b/common/.wezterm.lua @@ -32,11 +32,17 @@ config.font_size = 11 if wezterm.target_triple == 'aarch64-apple-darwin' then config.window_close_confirmation = 'NeverPrompt' config.window_decorations = "RESIZE" - config.font = wezterm.font{ + local weight = "Medium" + config.font_size = 12 + if wezterm.hostname() == "Jedrzejs-Mac-mini.local" then + config.font_size = 13 + weight = "Bold" + end + config.font = wezterm.font { family = 'Monaco Nerd Font', harfbuzz_features = { 'ss07', 'calt', 'liga=0' }, + weight = weight, } - config.font_size = 12 config.native_macos_fullscreen_mode = true else -- disable the window title bar diff --git a/debian/clangd b/debian/clangd new file mode 120000 index 0000000..8462b08 --- /dev/null +++ b/debian/clangd @@ -0,0 +1 @@ +../redundant/clangd \ No newline at end of file diff --git a/dotfiles_private b/dotfiles_private index 241c529..e94ab1a 160000 --- a/dotfiles_private +++ b/dotfiles_private @@ -1 +1 @@ -Subproject commit 241c5296e5a27c99f1e906d969faf4a0e8f28585 +Subproject commit e94ab1ab350fa00f5b5e1b561655d0b0a12ffb73 diff --git a/install.sh b/install.sh deleted file mode 100755 index 8bc5cfb..0000000 --- a/install.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bash - -set -x -set -e - -SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) - -copy=false -if [[ $1 == "--copy" ]]; then - copy=true -fi - -function add() { - rm -r "$2" || true - if [[ $copy == true ]]; then - cp -r "$1" "$2" - else - ln -s "$1" "$2" - fi -} - -# nvim -add "$SCRIPT_DIR/nvim" "$HOME/.config/nvim" - -# clangd -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - add "$SCRIPT_DIR/clangd" "$HOME/.config/clangd" -elif [[ "$OSTYPE" == "darwin"* ]]; then - macos_clangd_path="$HOME/Library/Preferences/clangd" - mkdir -p "$macos_clangd_path" - add "$SCRIPT_DIR/clangd" "$macos_clangd_path" -else - echo "OS type unknown. Exiting." - exit 1 -fi - -# tmux -add "$SCRIPT_DIR/.tmux.conf" "$HOME/.tmux.conf" - -# .wezterm -add "$SCRIPT_DIR/.wezterm.lua" "$HOME/.wezterm.lua" - -# snippets -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - vscode_snippets_path="$HOME/.config/Code/User/snippets" -elif [[ "$OSTYPE" == "darwin"* ]]; then - vscode_snippets_path="$HOME/Library/Application Support/Code/User/snippets" -else - echo "OS type unknown. Exiting." - exit 1 -fi -mkdir -p "$(dirname "${vscode_snippets_path}")" -add "$SCRIPT_DIR/nvim/snippets" "${vscode_snippets_path}" diff --git a/macos/.unison/default.prf b/macos/.unison/default.prf new file mode 100644 index 0000000..29b36b7 --- /dev/null +++ b/macos/.unison/default.prf @@ -0,0 +1,17 @@ +# roots define root directories for syncing between +root = /Users/jedrzej/Library/Mobile Documents/iCloud~md~obsidian/Documents/ +root = /Users/jedrzej/Dropbox/ObsidianVaults/ + +# dirs to sync +path=Personal + +# don't ask for confirmation +auto=true +batch=true +# sync ownership and group +owner=true +group=true +# for safety +confirmbigdel=true +# prefer newer in case of conflicts +prefer=newer diff --git a/macos/Library/Preferences/clangd b/macos/Library/Preferences/clangd new file mode 120000 index 0000000..c2e4d21 --- /dev/null +++ b/macos/Library/Preferences/clangd @@ -0,0 +1 @@ +../../../redundant/clangd \ No newline at end of file diff --git a/clangd/config.yaml b/redundant/clangd/config.yaml similarity index 100% rename from clangd/config.yaml rename to redundant/clangd/config.yaml diff --git a/set_up_debian_dev.sh b/scripts/debian/install.sh similarity index 97% rename from set_up_debian_dev.sh rename to scripts/debian/install.sh index 7c5602d..34e95f9 100755 --- a/set_up_debian_dev.sh +++ b/scripts/debian/install.sh @@ -2,6 +2,7 @@ set -e SCRIPT_DIR=$(dirname "$0") +ROOT_DIR=$(realpath "${SCRIPT_DIR}/../..") # Initialize a flag optional_provided=false @@ -19,7 +20,7 @@ function setup_nerdfont() { git clone https://github.com/epk/SF-Mono-Nerd-Font.git /tmp/SF-Mono-Nerd-Font cp /tmp/SF-Mono-Nerd-Font/*.otf ~/.local/share/fonts/ rm -rf /tmp/SF-Mono-Nerd-Font - cp "$SCRIPT_DIR"/dotfiles_private/fonts/* ~/.local/share/fonts/ + cp "$ROOT_DIR"/dotfiles_private/fonts/* ~/.local/share/fonts/ rm ~/.local/share/fonts/MonacoNerdFont-Regular.ttf fc-cache -f } @@ -27,7 +28,6 @@ function setup_nerdfont() { function setup_powerlevel10k() { git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k" || true sed -i 's/ZSH_THEME=\"robbyrussell\"/ZSH_THEME=\"powerlevel10k\/powerlevel10k\"/g' "$HOME/.zshrc" - cp "$SCRIPT_DIR/.p10k.zsh" "$HOME/" } function setup_sublimetext() { diff --git a/set_up_debian.sh b/scripts/debian/install_min.sh similarity index 98% rename from set_up_debian.sh rename to scripts/debian/install_min.sh index a9f963c..61a6869 100755 --- a/set_up_debian.sh +++ b/scripts/debian/install_min.sh @@ -1,6 +1,8 @@ #!/bin/bash set -e +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) + function get_highest_tag_version() { git tag | sort -V | tail -n 1 } @@ -265,7 +267,7 @@ ln -s $(which fdfind) $HOME/.local/bin/fd || true sudo apt install ripgrep -y || true # run set_up_common.sh -./set_up_common.sh +"$SCRIPT_DIR/../set_up_common.sh" if command -v doit &>/dev/null; then pipx install thefuck @@ -338,5 +340,3 @@ install_direnv install_delta install_gh - -echo "Done" diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100755 index 0000000..b8a5a2e --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash + +set -x +set -e + +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) +ROOT_DIR=$(dirname "$SCRIPT_DIR") + +copy=false +if [[ $1 == "--copy" ]]; then + copy=true +fi + +function add() { + rm -r "$2" || true + if [[ $copy == true ]]; then + cp -r "$1" "$2" + else + ln -s "$1" "$2" + fi +} + +# snippets +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + vscode_snippets_path="$HOME/.config/Code/User/snippets" +elif [[ "$OSTYPE" == "darwin"* ]]; then + vscode_snippets_path="$HOME/Library/Application Support/Code/User/snippets" +else + echo "OS type unknown. Exiting." + exit 1 +fi +mkdir -p "$(dirname "${vscode_snippets_path}")" +add "$SCRIPT_DIR/nvim/snippets" "${vscode_snippets_path}" + +cd "$ROOT_DIR" + +if ! [ -x "$(command -v stow)" ]; then + if [[ "$OSTYPE" == "linux-gnu"* ]]; then + sudo apt install stow -y + elif [[ "$OSTYPE" == "darwin"* ]]; then + if ! [ -x "$(command -v brew)" ]; then + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + fi + brew install stow + else + echo "Unsupported OS" + fi +fi + +# Stow common config +stow -t ~ common +cd dotfiles_private/stow +stow -t ~ common_private +cd ../.. + +# Stow platform-specific config +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + stow -t ~ debian + cd dotfiles_private/stow + stow -t ~ debian_private + cd ../.. + scripts/debian/install_min.sh + scripts/debian/install.sh --optional +elif [[ "$OSTYPE" == "darwin"* ]]; then + stow -t ~ macos + cd dotfiles_private/stow + stow -t ~ macos_private + cd ../.. + scripts/macos/install.sh +else + echo "Unsupported OS" +fi diff --git a/macos/install.sh b/scripts/macos/install.sh similarity index 74% rename from macos/install.sh rename to scripts/macos/install.sh index dd44936..130af54 100755 --- a/macos/install.sh +++ b/scripts/macos/install.sh @@ -2,9 +2,9 @@ set -e SCRIPT_DIR=$(dirname $0) -ROOT_DIR=$(dirname "$SCRIPT_DIR") +ROOT_DIR=$(realpath "${SCRIPT_DIR}/../..") -$ROOT_DIR/set_up_common.sh +$SCRIPT_DIR/../set_up_common.sh KEYBOARD_SOURCE_PATH="$HOME/Library/Mobile Documents/com~apple~CloudDocs/Random/Keyboard Layouts/Polish-German.bundle" KEYBOARD_TARGET_PATH="$HOME/Library/Keyboard Layouts/Polish-German.bundle" @@ -20,7 +20,7 @@ if ! grep -Fxq "PasswordAuthentication no" "$SSH_CONFIG_PATH"; then echo "ChallengeResponseAuthentication no" | sudo tee -a "$SSH_CONFIG_PATH" fi -# karabiner config -rm "$HOME/.config/karabiner.edn" -ln -s "$ROOT_DIR/dotfiles_private/karabiner.edn" "$HOME/.config/karabiner.edn" -goku || echo "goku not installed. Install with brew and run 'goku' when possible." +# run goku to install karabiner config +goku > /dev/null || echo "goku not installed. Install with brew and run 'goku' when possible." + +$SCRIPT_DIR/set_defaults.sh diff --git a/macos/set_defaults.sh b/scripts/macos/set_defaults.sh similarity index 96% rename from macos/set_defaults.sh rename to scripts/macos/set_defaults.sh index 3187bb6..961df6c 100755 --- a/macos/set_defaults.sh +++ b/scripts/macos/set_defaults.sh @@ -41,8 +41,11 @@ defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true # General UI/UX # ############################################################################### +echo "Disabling startup sound effects, password will be required" # Disable the sound effects on boot +set -x sudo nvram StartupMute=%01 +set +x # Disable crash report windows # https://stackoverflow.com/questions/6084497/silencing-osx-crash-report-window diff --git a/set_up_common.sh b/scripts/set_up_common.sh similarity index 93% rename from set_up_common.sh rename to scripts/set_up_common.sh index a937d94..42b1ae9 100755 --- a/set_up_common.sh +++ b/scripts/set_up_common.sh @@ -1,10 +1,12 @@ #!/bin/bash +set -e if [ -d ~/.oh-my-zsh ]; then echo "oh-my-zsh is installed" else echo "installing oh-my-zsh" sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended + echo "Changing default shell, password required" sudo chsh -s "$(which zsh)" "$(whoami)" || true git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "${ZSH_CUSTOM:-~/.oh-my-zsh/custom}"/plugins/zsh-syntax-highlighting git clone https://github.com/MenkeTechnologies/zsh-expand.git "${ZSH_CUSTOM:-~/.oh-my-zsh/custom}"/plugins/zsh-expand @@ -18,9 +20,6 @@ git config --global pull.rebase true git config --global user.name "Jedrzej Orbik" git config --global user.email Jendker@users.noreply.github.com -# copy the aliases -SCRIPT_DIR=$(dirname "$0") -cp "$SCRIPT_DIR/.aliases" ~/.aliases grep -qF 'source ~/.aliases' "$HOME/.zshrc" || echo '[ -e ~/.aliases ] && source ~/.aliases' >>"$HOME/.zshrc" grep -qxF 'eval "$(direnv hook zsh)"' "$HOME"/.zshrc || echo 'eval "$(direnv hook zsh)"' >>"$HOME/.zshrc" mkdir -p ~/.config/direnv diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh new file mode 100755 index 0000000..67e2023 --- /dev/null +++ b/scripts/uninstall.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -e + +# Unstow platform-specific config +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + cd dotfiles_private/stow + stow -D -t ~ debian_private + cd ../.. + stow -D -t ~ debian +elif [[ "$OSTYPE" == "darwin"* ]]; then + cd dotfiles_private/stow + stow -D -t ~ macos_private + cd ../.. + stow -D -t ~ macos +else + echo "Unsupported OS" +fi + +# Unstow common +cd dotfiles_private/stow +stow -D -t ~ common_private +cd ../.. +stow -D -t ~ common diff --git a/uninstall.sh b/uninstall.sh deleted file mode 100755 index ac1255f..0000000 --- a/uninstall.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -set -e - -rm -rf ~/.config/nvim -if [[ "$OSTYPE" == "linux-gnu"* ]]; then - rm -rf "$HOME/.config/clangd" -elif [[ "$OSTYPE" == "darwin"* ]]; then - rm -rf "$HOME/Library/Preferences/clangd/" -else - echo "OS type unknown. Exiting." - exit 1 -fi