From a3f7d765e9382aa6e62a7e91192ebeb67296b709 Mon Sep 17 00:00:00 2001 From: thek4n Date: Wed, 3 Apr 2024 14:49:27 +0300 Subject: [PATCH] ref(install-script): separate targets from main script --- TARGETS.sh | 22 ++++++++++++++++++++++ install | 26 +++----------------------- 2 files changed, 25 insertions(+), 23 deletions(-) create mode 100644 TARGETS.sh diff --git a/TARGETS.sh b/TARGETS.sh new file mode 100644 index 0000000..442e305 --- /dev/null +++ b/TARGETS.sh @@ -0,0 +1,22 @@ +declare -r -A TARGETS=( + ["colors"]=".config/terminal-colors.d" + ["tmux"]=".config/tmux .tmux .config/systemd/user/tmux.service" + ["bash"]=".config/bash .bashrc .profile %tmux %colors" + ["zsh"]="%bash .config/zsh .zshenv .inputrc" + ["alacritty"]=".config/alacritty" + ["nvim"]=".config/nvim .editorconfig .local/bin/vim_askpass_helper" + ["ssh"]="" + ["less"]=".lesskey" + ["git"]=".config/git" + ["ranger"]=".config/ranger" + ["gpg"]="" + ["i3"]=".xinitrc .xprofile .Xresources .config/i3 .config/i3status .local/bin/i3status_wrapper .config/rofi .config/picom .local/bin/slm .local/bin/slm_rofi.sh .local/bin/power_rofi.sh .local/bin/wifi .local/bin/bluetooth .local/bin/i3_switch_workspace.sh" + ["bat"]=".config/bat" + ["font"]="" + ["termux"]=".termux" + ["arch"]="" + ["psql"]=".psqlrc" + ["docker"]=".docker/cli-plugins" + ["ipython"]=".ipython/profile_default/ipython_config.py" + ["gdb"]=".config/gdb" +) \ No newline at end of file diff --git a/install b/install index 5c27b9a..879dcbe 100755 --- a/install +++ b/install @@ -8,29 +8,6 @@ declare -r DOTFILES_ROOT="$PWD" declare -xr SUB="$DOTFILES_ROOT/home/user" -declare -r -A TARGETS=( - ["colors"]=".config/terminal-colors.d" - ["tmux"]=".config/tmux .tmux .config/systemd/user/tmux.service" - ["bash"]=".config/bash .bashrc .profile %tmux %colors" - ["zsh"]="%bash .config/zsh .zshenv .inputrc" - ["alacritty"]=".config/alacritty" - ["nvim"]=".config/nvim .editorconfig .local/bin/vim_askpass_helper" - ["ssh"]="" - ["less"]=".lesskey" - ["git"]=".config/git" - ["ranger"]=".config/ranger" - ["gpg"]="" - ["i3"]=".xinitrc .xprofile .Xresources .config/i3 .config/i3status .local/bin/i3status_wrapper .config/rofi .config/picom .local/bin/slm .local/bin/slm_rofi.sh .local/bin/power_rofi.sh .local/bin/wifi .local/bin/bluetooth .local/bin/i3_switch_workspace.sh" - ["bat"]=".config/bat" - ["font"]="" - ["termux"]=".termux" - ["arch"]="" - ["psql"]=".psqlrc" - ["docker"]=".docker/cli-plugins" - ["ipython"]=".ipython/profile_default/ipython_config.py" - ["gdb"]=".config/gdb" -) - _die() { echo "$0: $1" >&2 exit $2 @@ -39,6 +16,9 @@ _die() { test "$0" = "./install" || _die "Error: Please, run this file from root of dotfiles, like this './install.sh TARGET" 1 +source "$DOTFILES_ROOT/TARGETS.sh" + + _link_files_in_sandbox() { local targetfile for targetfile in "$@"