Make install.sh work on base 3.2 (for macOS)
This commit is contained in:
parent
9964392ee0
commit
38f5bb7f9c
46
install.sh
46
install.sh
@ -5,28 +5,11 @@ if [ ! -d $HOME/.local/share/tmux/layouts ]; then
|
|||||||
echo changed created layouts directory
|
echo changed created layouts directory
|
||||||
fi
|
fi
|
||||||
|
|
||||||
declare -A symlinks=(
|
symlink() {
|
||||||
[$HOME/.config/tmux/tmux.conf]=$HOME/.tmux.conf
|
local source=$1
|
||||||
)
|
local dest=$2
|
||||||
|
|
||||||
layouts=(
|
|
||||||
session-config
|
|
||||||
session-infra
|
|
||||||
session-main
|
|
||||||
session-visor
|
|
||||||
window-auto
|
|
||||||
window-tall
|
|
||||||
window-wide-left
|
|
||||||
window-wide-right
|
|
||||||
)
|
|
||||||
for layout in ${layouts[@]}; do
|
|
||||||
symlinks[$HOME/.config/tmux/layouts/$layout]=$HOME/.local/share/tmux/layouts/$layout
|
|
||||||
done
|
|
||||||
|
|
||||||
for source in ${!symlinks[@]}; do
|
|
||||||
dest=${symlinks[${source}]}
|
|
||||||
if [ -L $dest ]; then
|
if [ -L $dest ]; then
|
||||||
target=`readlink $dest`
|
local target=`readlink $dest`
|
||||||
if [ "$target" != "$source" ]; then
|
if [ "$target" != "$source" ]; then
|
||||||
rm $dest
|
rm $dest
|
||||||
ln -s $source $dest
|
ln -s $source $dest
|
||||||
@ -38,4 +21,23 @@ for source in ${!symlinks[@]}; do
|
|||||||
ln -s $source $dest
|
ln -s $source $dest
|
||||||
echo changed created symlink $dest
|
echo changed created symlink $dest
|
||||||
fi
|
fi
|
||||||
done
|
}
|
||||||
|
|
||||||
|
symlink $HOME/.config/tmux/tmux.conf \
|
||||||
|
$HOME/.tmux.conf
|
||||||
|
symlink $HOME/.config/tmux/layouts/session-config \
|
||||||
|
$HOME/.local/share/tmux/layouts/session-config
|
||||||
|
symlink $HOME/.config/tmux/layouts/session-infra \
|
||||||
|
$HOME/.local/share/tmux/layouts/session-infra
|
||||||
|
symlink $HOME/.config/tmux/layouts/session-main \
|
||||||
|
$HOME/.local/share/tmux/layouts/session-main
|
||||||
|
symlink $HOME/.config/tmux/layouts/session-visor \
|
||||||
|
$HOME/.local/share/tmux/layouts/session-visor
|
||||||
|
symlink $HOME/.config/tmux/layouts/window-auto \
|
||||||
|
$HOME/.local/share/tmux/layouts/window-auto
|
||||||
|
symlink $HOME/.config/tmux/layouts/window-tall \
|
||||||
|
$HOME/.local/share/tmux/layouts/window-tall
|
||||||
|
symlink $HOME/.config/tmux/layouts/window-wide-left \
|
||||||
|
$HOME/.local/share/tmux/layouts/window-wide-left
|
||||||
|
symlink $HOME/.config/tmux/layouts/window-wide-right \
|
||||||
|
$HOME/.local/share/tmux/layouts/window-wide-right
|
||||||
|
Loading…
x
Reference in New Issue
Block a user