Enable standalone install with install.sh
Move away from being dependant on Ansible task.yaml config setup and move all login into install.sh to support installing tmux config just by cloning and running the script.
This commit is contained in:
40
install.sh
Executable file
40
install.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ ! -d ~/.local/share/tmux/layouts ]; then
|
||||
mkdir -p ~/.local/share/tmux/layouts
|
||||
echo changed created layouts directory
|
||||
fi
|
||||
|
||||
declare -A symlinks=(
|
||||
[~/.config/tmux/tmux.conf]=~/.tmux.conf
|
||||
)
|
||||
|
||||
layouts=(
|
||||
session-local
|
||||
session-main
|
||||
session-visor
|
||||
window-auto
|
||||
window-tall
|
||||
window-wide-left
|
||||
window-wide-right
|
||||
)
|
||||
for layout in ${layouts[@]}; do
|
||||
symlinks[~/.config/tmux/layouts/$layout]=~/.local/share/tmux/layouts/$layout
|
||||
done
|
||||
|
||||
for source in ${!symlinks[@]}; do
|
||||
dest=${symlinks[${source}]}
|
||||
if [ -L $dest ]; then
|
||||
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
|
||||
done
|
||||
Reference in New Issue
Block a user