-
Notifications
You must be signed in to change notification settings - Fork 9
/
restore.sh
executable file
·99 lines (80 loc) · 2.02 KB
/
restore.sh
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
#!/usr/bin/env bash
set -e
set -x
cd $HOME
mkdir -p $HOME/.config
DIR="git/serverconfig"
mkdir -p $HOME/.lc
ln -sf "../$DIR/lc/config.json" $HOME/.lc/
configs=(
.globalrc
.clang_complete
.editorconfig
.gdbinit
.gdbinit.d
.cgdb
.docker
.jelly-conky
.direnvrc
.clang-format
.ctags
.gitconfig
.Xresources
.xprofile
.xinitrc
.gtkrc-2.0
.stalonetrayrc
.bashrc
.perltidyrc
.wgetrc
.npmrc
.prettierrc
.bash_profile
.chisels
.gitignore_global
.fakevimrc
.terminfo
.xsettingsd
.proxychains
.ideavimrc
scripts
)
for config in "${configs[@]}"; do
rm -rf "$HOME/$config"
ln -sf "$DIR/$config" $HOME/
done
for dotconfig in "$DIR/.config/"*; do
rm -rf "$HOME/.config/$(basename "$dotconfig")"
ln -sf "../$dotconfig" $HOME/.config/
done
mkdir -p $HOME/.local/share/
ln -sf /tmp/gentoo/usr/share/grc $HOME/.local/share/
for share in "$DIR/.local/share/"*; do
rm -rf "$HOME/.local/share/$(basename "$share")"
ln -sf "../../$share" $HOME/.local/share/
done
rm -rf $HOME/.tmux
rm -rf $HOME/.tmux.conf
ln -sf "$DIR/.tmux" $HOME/
ln -sf "$DIR/.tmux/.tmux.conf" $HOME/
ln -sf "/tmp/gentoo/emacs" $HOME/.emacs.d
lesskey "$DIR/lesskey"
mkdir -p -m 700 $HOME/.ssh
cp "$DIR"/id_rsa.pub $HOME/.ssh/
if [[ $# == 0 ]]; then
if [ ! -d $HOME/.password-store/.git ]; then
rm -rf $HOME/.password-store
git clone [email protected]:amosbird/pass-store $HOME/.password-store
fi
(cd $HOME/.password-store && git pull)
gpg --keyserver keyserver.ubuntu.com --recv-keys 80D430DCBECFEDB4
echo -e "5\ny\n" | gpg --command-fd 0 --expert --edit-key 80D430DCBECFEDB4 trust
gpg --keyserver keyserver.ubuntu.com --recv-keys C3BFA922206F41DA
echo -e "5\ny\n" | gpg --command-fd 0 --expert --edit-key C3BFA922206F41DA trust
fi
if [[ -n $GUI ]]; then
update-desktop-database "$HOME/.local/share/applications"
sudo cp -r "$DIR"/xkb/* /usr/share/X11/xkb/symbols/
setxkbmap us
fi
echo 'Restored!'