Compare commits
No commits in common. "dd9e1ebdd96f828ab0742c470815888d70286527" and "adfe835e7bcae5f49ea5960ba8d834e78ce27124" have entirely different histories.
dd9e1ebdd9
...
adfe835e7b
File diff suppressed because one or more lines are too long
52
link.sh
52
link.sh
|
@ -1,48 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
link() {
|
stow --restow --target="$HOME/.config/alacritty" alacritty
|
||||||
src="$1"
|
stow --restow --target="$HOME/.config/fish" fish
|
||||||
dst="$2"
|
stow --restow --target="$HOME/.config/flavours" flavours
|
||||||
|
stow --restow --target="$HOME/.config/newsboat" newsboat
|
||||||
if [ "$src" = "" ] || [ "$dst" = "" ]; then
|
stow --restow --target="$HOME/.config/nvim" nvim
|
||||||
echo "Source or destination parameter missing." >&2
|
stow --restow --target="$HOME/.config/tmux" tmux
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e "$src" ]; then
|
|
||||||
echo "Source file not found." >&2
|
|
||||||
exit 3
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -e "$dst" ] && [ ! -L "$dst" ]; then
|
|
||||||
echo "Destination exists and is not a symlink." >&2
|
|
||||||
exit 4
|
|
||||||
fi
|
|
||||||
|
|
||||||
full_src=$(realpath -s "$src")
|
|
||||||
full_dst=$(realpath -s "$dst")
|
|
||||||
|
|
||||||
if [ -L "$dst" ]; then
|
|
||||||
if [ "$full_dst" != "$full_src" ]; then
|
|
||||||
ln -s -f "$full_src" "$full_dst"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
ln -s "$full_src" "$full_dst"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
cd "$(dirname "$(readlink -f "$0")")" || exit 1
|
|
||||||
|
|
||||||
link ./alacritty/alacritty.yml "$HOME/.config/alacritty/alacritty.yml"
|
|
||||||
|
|
||||||
link ./fish/abbr.fish "$HOME/.config/fish/abbr.fish"
|
|
||||||
link ./fish/config.fish "$HOME/.config/fish/config.fish"
|
|
||||||
|
|
||||||
link ./flavours/config.toml "$HOME/.config/flavours/config.toml"
|
|
||||||
|
|
||||||
link ./newsboat/config "$HOME/.config/newsboat/config"
|
|
||||||
|
|
||||||
link ./nvim/init.lua "$HOME/.config/nvim/init.lua"
|
|
||||||
link ./nvim/vim_plugins.sh "$HOME/scripts/vim_plugins.sh"
|
|
||||||
|
|
||||||
link ./tmux/tmux.conf "$HOME/.tmux.conf"
|
|
||||||
|
|
Loading…
Reference in New Issue