tmux/install.sh

44 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
if [ ! -d $HOME/.local/share/tmux/layouts ]; then
mkdir -p $HOME/.local/share/tmux/layouts
echo changed created layouts directory
fi
symlink() {
local source=$1
local dest=$2
if [ -L $dest ]; then
local target=`readlink $dest`
if [ "$target" != "$source" ]; then
rm $dest
ln -s $source $dest
echo changed replace incorrect symlink $dest
fi
elif [ -f $dest ]; then
error symlink failed $dest exists but is a regular file
else
ln -s $source $dest
echo changed created symlink $dest
fi
}
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