-
Notifications
You must be signed in to change notification settings - Fork 1
/
install
executable file
·68 lines (59 loc) · 2.32 KB
/
install
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
63
64
65
66
67
68
#!/usr/bin/env bash
DOTFILES_FOLDER="$HOME/dotfiles"
FOLDERS_LINUX=$(echo "bin nvim alacritty bash tmux i3 polybar fontconfig starship")
FOLDERS_I3=$(echo "i3 polybar dunst rofi picom")
FOLDERS_MAC=$(echo "bin alacritty nvim zsh bash tmux gnupg-mac starship")
FOLDERS=$(echo "")
# remove .zshrc if it exists so we can
# create it with the correct version for the environment
if [ -f $DOTFILES_FOLDER/bash/.bashrc ]; then
rm $DOTFILES_FOLDER/bash/.bashrc
fi
# remove alacritty config if it exists so we can
# create it with the correct version for the environment
if [ -f $DOTFILES_FOLDER/alacritty/.config/alacritty/alacritty.toml ]; then
rm $DOTFILES_FOLDER/alacritty/.config/alacritty/alacritty.toml
fi
# remove kitty config if it exists so we can
# create it with the correct version for the environment
if [ -f $DOTFILES_FOLDER/kitty/.config/kitty/kitty.conf ]; then
rm $DOTFILES_FOLDER/kitty/.config/kitty/kitty.conf
fi
# make sure some folders exist before stow takes control
mkdir -p $HOME/.config/tmux/plugins/
mkdir -p $HOME/.local/bin/
touch $HOME/.config/tmux/plugins/.placeholder
touch $HOME/.local/bin/.placeholder
case $1 in
--macos )
INSTALL_ENV="macos"
FOLDERS=$FOLDERS_MAC
cp $DOTFILES_FOLDER/bash/.bashrc_macos $HOME/dotfiles/bash/.bashrc
cp $DOTFILES_FOLDER/alacritty/.config/alacritty/alacritty_macos.toml $DOTFILES_FOLDER/alacritty/.config/alacritty/alacritty.toml
cp $DOTFILES_FOLDER/kitty/.config/kitty/kitty_macos.conf $DOTFILES_FOLDER/kitty/.config/kitty/kitty.conf
;;
--linux )
INSTALL_ENV="linux"
FOLDERS=$FOLDERS_LINUX
cp $DOTFILES_FOLDER/bash/.bashrc_linux $DOTFILES_FOLDER/bash/.bashrc
cp $DOTFILES_FOLDER/alacritty/.config/alacritty/alacritty_linux.toml $DOTFILES_FOLDER/alacritty/.config/alacritty/alacritty.toml
cp $DOTFILES_FOLDER/kitty/.config/kitty/kitty_linux.conf $DOTFILES_FOLDER/kitty/.config/kitty/kitty.conf
;;
--i3 )
INSTALL_ENV="I3"
FOLDERS=$FOLDERS_I3
cp $DOTFILES_FOLDER/bash/.bashrc_linux $DOTFILES_FOLDER/bash/.bashrc
cp $DOTFILES_FOLDER/alacritty/.config/alacritty/alacritty_linux.toml $DOTFILES_FOLDER/alacritty/.config/alacritty/alacritty.toml
;;
* )
echo -e "Please specify which environment to install:\n--linux\n--macos"
exit
;;
esac
echo "Installing for env: $INSTALL_ENV"
for folder in $FOLDERS
do
echo "Installing $folder"
stow -D $folder
stow $folder
done