install: make ~/.config a symlink into dotfiles
This commit is contained in:
parent
326ba2d607
commit
61f0b64b84
67 changed files with 43 additions and 25 deletions
2
.gitattributes
vendored
2
.gitattributes
vendored
|
@ -1,2 +1,2 @@
|
|||
ssh/.ssh/config filter=git-crypt diff=git-crypt
|
||||
home/.ssh/config filter=git-crypt diff=git-crypt
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
directory for extra git configurations
|
61
install.sh
61
install.sh
|
@ -18,7 +18,9 @@ main() {
|
|||
esac done
|
||||
|
||||
greeting
|
||||
stow_packages
|
||||
make_dirs
|
||||
stow_home
|
||||
link_config
|
||||
git_user_config
|
||||
nvim_plugins
|
||||
}
|
||||
|
@ -41,24 +43,45 @@ greeting() {
|
|||
}
|
||||
}
|
||||
|
||||
stow_packages() {
|
||||
heading 'stow packages'
|
||||
stow -v${IS_DRY_RUN:+n} --no-folding -d "$DOTFILES" -t "$TARGET" \
|
||||
alacritty \
|
||||
bin \
|
||||
git \
|
||||
jupyter \
|
||||
mintty \
|
||||
misc \
|
||||
nvim \
|
||||
python \
|
||||
readline \
|
||||
shell \
|
||||
ssh \
|
||||
tmux \
|
||||
x11 \
|
||||
zsh \
|
||||
2>&1 | sed -E -e "s/^([^:]+:)/$yellow\1$rst/" -e "s/=>/$blue=>$rst/"
|
||||
make_dirs() {
|
||||
heading 'create auxiliary directories'
|
||||
while read item; do
|
||||
dir="$TARGET/$item"
|
||||
if [ ! -d "$dir" ]; then
|
||||
echo "${yellow}MKDIR:$rst $dir"
|
||||
dry_run || mkdir -p "$dir"
|
||||
fi
|
||||
done <<EOF
|
||||
.local/share/less/
|
||||
.local/share/python/
|
||||
.local/share/nvim/shada/
|
||||
.local/share/zsh/
|
||||
.local/etc/git/
|
||||
EOF
|
||||
}
|
||||
|
||||
link_config() {
|
||||
heading 'link .config directory'
|
||||
|
||||
link="$TARGET/.config"
|
||||
dotfiles_config="$DOTFILES/config"
|
||||
backup="$TARGET/old_dot_config"
|
||||
|
||||
if [ "$(readlink "$link")" != "$dotfiles_config" ]; then
|
||||
if [ -d "$link" ]; then
|
||||
echo "${red}WARNING:$rst moving existing '$link' to '$backup'"
|
||||
dry_run || mv "$link" "$backup"
|
||||
fi
|
||||
|
||||
echo "${yellow}LINK:$rst $link $blue=>$rst $dotfiles_config"
|
||||
dry_run || ln -s "$dotfiles_config" "$link"
|
||||
fi
|
||||
}
|
||||
|
||||
stow_home() {
|
||||
heading 'stow home directory'
|
||||
stow -v${IS_DRY_RUN:+n} --no-folding -d "$DOTFILES" -t "$TARGET" home 2>&1 \
|
||||
| sed -E -e "s/^([^:]+:)/$yellow\1$rst/" -e "s/=>/$blue=>$rst/"
|
||||
}
|
||||
|
||||
git_user_config() {
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
directory for less(1) history
|
|
@ -1 +0,0 @@
|
|||
nvim SHAred DAta directory
|
|
@ -1 +0,0 @@
|
|||
directory for python REPL history
|
|
@ -1 +0,0 @@
|
|||
directory for zsh history
|
Loading…
Add table
Reference in a new issue