-
Notifications
You must be signed in to change notification settings - Fork 1
/
make_env
executable file
·156 lines (127 loc) · 2.74 KB
/
make_env
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/usr/bin/env bash
backup="${HOME}/config.orig"
function link_dotfile {
src=${1}
dst=${2}
if [ -e ${backup}/${dst} ];then
rm -rf ${backup}/${dst}
fi
dst_dir=${backup}/${dst}
dst_dir=${dst_dir%/*}
if [ ! -e ${dst_dir} ];then
mkdir -p ${dst_dir}
fi
if [ -e ${HOME}/${dst} ];then
mv ${HOME}/${dst} ${backup}/${dst}
fi
ln -fs ${PWD}/${src} ${HOME}/${dst}
}
if [ ! -e ${backup} ]; then
mkdir ${backup}
fi
# .Xmodmap.mac \
# .Xmodmap.ubuntu \
# .Xdefaults \
# .Xresources \
# .config \
# .git \
# .gitmodules \
# .gnupg \
# .ssh \
# crontab \
# global.gitconfig \
# global.gitignore \
# make_env \
# rc.local.ubuntu \
# .msmtprc \
for f in \
.agignore \
.bash_profile \
.bashrc \
.ctags \
.conkyrc \
.curlrc \
.fetchmailrc \
.gemrc \
.globalrc \
.gitignore \
.gvimrc \
.ideavimrc \
.infokey \
.inputrc \
.lv \
.mailcap \
.mayu \
.mutt \
.offlineimaprc \
.pryrc \
.psqlrc \
.screenrc \
.termcap \
.tigrc \
.tmux.conf \
.vim \
.wgetrc \
.w3m \
.xprofile \
.xsession \
.mlterm \
bash_misc_func \
cronscripts \
skk-dic \
bin \
.config/awesome \
.config/pgclid
do
link_dotfile ${f} ${f}
done
case $OSTYPE in
darwin*)
link_dotfile .Xmodmap.mac .Xmodmap
mkdir -p ~/Library/Preferences/kitty
kitty.conf ~/Library/Preferences/kitty/kitty.conf
ln -s ~/config/Library/Application\ Support/Karabiner ~/Library/Application\ Support/Karabiner
;;
freebsd*)
;;
linux*)
# link_dotfile .Xmodmap.ubuntu .Xmodmap
mkdir -p ~/.config/kitty/
kitty.conf ~/.config/kitty/kitty.conf
;;
*)
;;
esac
if [ ! -e ~/.config ];then
mkdir ~/.config
fi
link_dotfile .config/awesome .config/awesome
mv ~/.fetchmailrc ${backup}/.fetchmailrc
ln -s ./Dropbox/env/livesense/dot.fetchmailrc ~/.fetchmailrc
mv ~/.msmtprc ${backup}/.fetchmailrc
ln -s ./Dropbox/env/livesense/dot.msmtprc ~/.msmtprc
mv ~/.gitignore ${backup}/.gitignore
ln -s ${PWD}/global.gitignore ~/.gitignore
# mv ~/.gitconfig ${backup}/.gitconfig
# ln -s ${PWD}/global.gitconfig ~/.gitconfig
mkdir -p ${HOME}/.config
ln -snfv ${HOME}/config/.vim ${HOME}/.config/nvim
ln -snfv ${HOME}/config/i3 ${HOME}/.config/i3
# choice
ln -snvf ${HOME}/config/lemonade_server.toml ${HOME}/.config/lemonade.toml
ln -snvf ${HOME}/config/lemonade_client.toml ${HOME}/.config/lemonade.toml
# Karabikna
#wakatime
ln -s ${HOME}/Dropbox/secure/dot.wakatime.cfg ${HOME}/.wakatime.cfg
mkdir -p ${HOME}/.docker
ln -s ${HOME}/config/.docker/config.json ${HOME}/.docker/config.json
mkdir -p ${HOME}/.config/karabiner/assets/complex_modifications
for f in ./karabiner/*.json ; do
ln -s ${f} ${HOME}/.config/karabiner/assets/complex_modifications/
done
echo "
.ssh \
.gnupg \
is not linked.
"
echo "set iterm2 load preferences directory to ~/config/Library/Preferences and enable save when quit."