-
Notifications
You must be signed in to change notification settings - Fork 0
/
sync.sh
112 lines (98 loc) · 5.32 KB
/
sync.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
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
# cd to <dotfiles> first before execute this file;
# this file must be in '~/dotfiles/'.
if [[ `uname` == "Linux" ]]; then
if [[ $(cd `dirname "$0"`;pwd) != ~/dotfiles ]]; then
echo 'Is NOT in ~/dotfiles'
exit
fi
# vim & neovim
cp -r ~/dotvim/autoload ./vim/dotvim/
cp -r ~/dotvim/init ./vim/dotvim/
cp -r ~/dotvim/share ./vim/dotvim/
cp ~/.config/nvim/init.lua ./vim/nvim/
#cp ~/.config/nvim/init.vim ./vim/nvim/
# zsh
cp ~/.zshrc ./root/home/
cp ~/.zprofile ./root/home/
cp ~/.Xmodmap ./root/home/
cp ~/.tmux.conf ./root/home/
cp ~/.tmux-status.conf ./root/home/
cp ~/.gitconfig ./root/home/
cp ~/.gdbinit ./root/home/
# config
cp ~/.config/user-dirs.dirs ./root/home/.config/
cp -r ~/.config/i3 ./root/home/.config/
cp -r ~/.config/i3status ./root/home/.config/
cp -r ~/.config/rofi ./root/home/.config/
cp -r ~/.config/fontconfig ./root/home/.config/
cp ~/.config/lf/lfrc ./root/home/.config/lf/
cp ~/.cargo/config ./root/home/.cargo/
cp ~/.pip/pip.conf ./root/home/.pip/
## Arch
if [[ `uname -r` =~ "arch" ]]; then
# home/.config
cp ~/.config/xfce4/terminal/terminalrc ./root/home/.config/xfce4/terminal/
cp ~/.config/alacritty/alacritty.toml ./root/home/.config/alacritty/
# X11
cp ~/.Xresources ./root/home-arch/
cp ~/.xinitrc ./root/home-arch/
cp ~/.nvidia-xinitrc ./root/home-arch/
cp ~/.inputrc ./root/home-arch/
cp /etc/X11/xorg.conf ./root/etc-arch/X11/
cp /etc/X11/xorg.conf.d/30-touchpad.conf ./root/etc-arch/X11/xorg.conf.d
cp /etc/X11/nvidia-xorg.conf ./root/etc-arch/X11/
cp -r /etc/X11/nvidia-xorg.conf.d ./root/etc-arch/X11/
# systemd
cp /etc/systemd/logind.conf ./root/etc-arch/systemd/
cp /etc/systemd/system.conf ./root/etc-arch/systemd/
# pacman
cp /etc/pacman.conf ./root/etc-arch/
# modules
cp -r /etc/modprobe.d ./root/etc-arch/
cp -r /etc/modules-load.d ./root/etc-arch/
echo "Arch: Copy was completed!"
fi
# Ubuntu
if [[ `uname -v` =~ "Ubuntu" ]]; then
# home/.config
cp ~/.config/libinput-gestures.conf ./root/home/.config/
echo "Ubuntu: Copy was completed!"
fi
elif [[ `uname -o` == "Msys" || `uname -o` == "Cygwin" ]]; then
if [ ! -d "$DOT_HOME/dotvim" ]; then
echo "$DOT_HOME/dotvim is not existed."
exit
fi
# vim & neovim
cp -r $DOT_HOME/dotvim/autoload ./vim/dotvim/
cp -r $DOT_HOME/dotvim/init ./vim/dotvim/
cp -r $DOT_HOME/dotvim/share ./vim/dotvim/
cp $LOCALAPPDATA/nvim/init.lua ./vim/nvim/
#cp $LOCALAPPDATA/nvim/init.vim ./vim/nvim/
# gw
cp $DOT_APPS/msys64/ucrt64.ini ./disk/msys2/
cp $DOT_APPS/msys64/etc/pacman.conf ./disk/msys2/etc/
cp $DOT_APPS/msys64/etc/pacman.d/mirrorlist.msys ./disk/msys2/etc/pacman.d
cp $DOT_APPS/msys64/etc/pacman.d/mirrorlist.mingw32 ./disk/msys2/etc/pacman.d
cp $DOT_APPS/msys64/etc/pacman.d/mirrorlist.mingw64 ./disk/msys2/etc/pacman.d
cp $DOT_APPS/msys64/etc/pacman.d/mirrorlist.ucrt64 ./disk/msys2/etc/pacman.d
cp ~/.minttyrc ./disk/msys2/home/
cp ~/.gitconfig ./disk/msys2/home/
cp ~/.zshrc ./disk/msys2/home/
cp ~/.tmux.conf ./disk/msys2/home/
cp ~/.tmux-status.conf ./disk/msys2/home/
# win
cp $USERPROFILE/.cargo/config ./disk/home/.cargo/
cp $USERPROFILE/pip/pip.ini ./disk/home/pip/
cp $USERPROFILE/.condarc ./disk/home/
cp $USERPROFILE/clink_inputrc ./disk/home/
cp -r $USERPROFILE/Documents/WindowsPowerShell ./disk/home/Documents/
cp -r $USERPROFILE/Documents/PowerShell ./disk/home/Documents/
cp $APPDATA/lazygit/config.yml ./disk/home/AppData/Roaming/lazygit/
cp $LOCALAPPDATA/lf/lfrc ./disk/home/AppData/Local/lf/
# scoop
cp $DOT_APPS/_packs/persist/windows-terminal/settings/settings.json ./disk/scoop/windows-terminal/settings/
cp -r $DOT_APPS/_packs/persist/conemu ./disk/scoop/
echo "Win: Copy was completed!"
fi