-
Notifications
You must be signed in to change notification settings - Fork 0
/
init
executable file
·62 lines (60 loc) · 1.95 KB
/
init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh
if [ $# -eq 0 ]; then
echo 'Usage: init [bash|git|hammerspoon|kitty|neovim|prettier|screen|tmux|zellij|zsh] ...'
else
DOTFILES_ABS="$(cd $(dirname $0); pwd -P)"
DOTFILES="$DOTFILES_ABS"
case "$DOTFILES" in
$HOME* ) DOTFILES="~${DOTFILES#$HOME}" ;;
esac
for i do
case "$i" in
bash )
echo "source $DOTFILES/shell/.profile" >> $HOME/.profile
echo "source $DOTFILES/shell/.bashrc" >> $HOME/.bashrc
;;
git )
git config --global include.path "$DOTFILES/.gitconfig"
;;
hammerspoon )
mkdir -p $HOME/.hammerspoon/Spoons/
echo "dofile('$DOTFILES_ABS/hammerspoon.lua')" >> $HOME/.hammerspoon/init.lua
curl -LO "https://github.com/Hammerspoon/Spoons/raw/master/Spoons/ClipboardTool.spoon.zip"
unzip -d $HOME/.hammerspoon/Spoons/ ClipboardTool.spoon.zip
rm ClipboardTool.spoon.zip
;;
kitty )
mkdir -p $HOME/.config/kitty/
ln -s $DOTFILES_ABS/kitty/mime.types $DOTFILES_ABS/kitty/open-actions.conf $HOME/.config/kitty/
echo "include $DOTFILES/kitty/kitty.conf" >> $HOME/.config/kitty/kitty.conf
;;
neovim )
mkdir -p $HOME/.config/nvim/
echo "dofile('$DOTFILES_ABS/vim/init.lua')" >> $HOME/.config/nvim/init.lua
echo "dofile('$DOTFILES_ABS/vim/abbreviations.lua')" >> $HOME/.config/nvim/init.lua
;;
prettier )
cp $DOTFILES_ABS/.prettierrc $HOME
;;
screen )
echo "source $DOTFILES_ABS/.screenrc" >> $HOME/.screenrc
;;
tmux )
if [ ! -d $HOME/.tmux/plugins/tpm ]; then git clone https://github.com/tmux-plugins/tpm $HOME/.tmux/plugins/tpm; fi
echo "source-file $DOTFILES/.tmux.conf" >> $HOME/.tmux.conf
;;
zellij )
mkdir -p $HOME/.config/zellij/
ln -s $DOTFILES_ABS/zellij.kdl $HOME/.config/zellij/config.kdl
;;
zsh )
echo "source $DOTFILES/shell/.profile" >> $HOME/.profile
ln -s $HOME/.profile $HOME/.zprofile
echo "source $DOTFILES/shell/.zshrc" >> $HOME/.zshrc
;;
* )
echo "Unrecognized: $i"
;;
esac
done
fi