-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·122 lines (110 loc) · 2.54 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#! /bin/bash
set -eu
ROOT="$(dirname "${0}")"
function install_gitk {
gitdir=${HOME}/.config/git
mkdir -vp "${gitdir}"
cp -vf \
"${ROOT}"/git/gitk-{light,light2,light3,dark,dark2,dark3} \
"${gitdir}"/
}
function install_neovim {
neovimdir=${HOME}/.config/nvim
mkdir -vp \
"${neovimdir}"/colors \
"${neovimdir}"/autoload/airline/themes
cp -vf "${ROOT}"/colors/colorific.vim "${neovimdir}"/colors/
cp -vf \
"${ROOT}"/autoload/airline/themes/colorific.vim \
"${neovimdir}"/autoload/airline/themes/
}
function install_alacritty {
alacrittydir=${HOME}/.config/alacritty
mkdir -vp "${alacrittydir}"
cp -vf "${ROOT}"/alacritty/colorific.yml "${alacrittydir}/"
}
function install_kitty {
kittydir=${HOME}/.config/kitty/themes
mkdir -vp "${kittydir}"
cp -vf \
"${ROOT}"/kitty/{light,light2,light3,dark,dark2,dark3}.conf \
"${kittydir}/"
}
function install_tmux {
tmuxdir=${HOME}/.tmux
mkdir -vp "${tmuxdir}"
cp -vf \
"${ROOT}"/tmux/{light,light2,light3,dark,dark2,dark3}.tmuxtheme \
"${tmuxdir}/"
}
function install_vim {
vimdir=${HOME}/.vim
mkdir -vp "${vimdir}"/colors "${vimdir}"/autoload/airline/themes
cp -vf "${ROOT}"/colors/colorific.vim "${vimdir}"/colors/
cp -vf \
"${ROOT}"/autoload/airline/themes/colorific.vim \
"${vimdir}"/autoload/airline/themes/
}
function print_usage {
echo "./install usage:"
echo " -a|--alacritty install alacritty files"
echo " -g|--gitk install gitk files"
echo " -k|--kitty install kitty files"
echo " -n|--neovim install neovim files"
echo " -t|--tmux install tmux files"
echo " -v|--vim install vim files"
echo " -h|--help print this message"
}
OPTIONS=aghkntv
LONGOPTIONS=alacritty,git,help,kitty,neovim,tmux,vim
PARSED=$(getopt -o ${OPTIONS} --long ${LONGOPTIONS} -n "${0}" -- "${@}")
eval set -- "${PARSED}"
if [ ${#} -eq 1 ]; then
install_alacritty
install_gitk
install_kitty
install_neovim
install_tmux
install_vim
fi
while [ ${#} -ge 1 ]; do
case ${1} in
-a|--alacritty)
install_alacritty
shift
;;
-g|--gitk)
install_gitk
shift
;;
-k|--kitty)
install_kitty
shift
;;
-n|--neovim)
install_neovim
shift
;;
-t|--tmux)
install_tmux
shift
;;
-v|--vim)
install_vim
shift
;;
-h|--help)
print_usage
exit
;;
--)
shift
break
;;
*)
echo "ERROR: invalid flag ${2@Q}."
exit 3
;;
esac
done
echo "Done."