-
Notifications
You must be signed in to change notification settings - Fork 13
/
backup_script.sh
executable file
·153 lines (125 loc) · 2.68 KB
/
backup_script.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
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
#!/bin/bash
## author: si9ma
## my blog: si9ma.com
##
## add your backup function here
## function backup_<your config name>
##
# log
exec 2> >(tee -a "installer.log")
# backup terminator config
function backup_terminator
{
mkdir -p ./config/terminator
cp ~/.config/terminator/* ./config/terminator/ -r
}
# backup vim
function backup_vim
{
mkdir -p ./config/vim/
cp ~/.vimrc ./config/vim/
}
# backup git
function backup_git
{
cp ~/.gitconfig ./config/git/
}
# backup oh-my-zsh
function backup_oh-my-zsh
{
# zsh config
cp ~/.zshrc ./config/zsh/
# auto jump plugin
cp ~/.local/share/autojump/autojump.txt ./config/zsh/
# dircolors
cp ~/.dircolors ./config/zsh/
# zsh_history
cp ~/.zsh_history ./config/zsh/
}
function backup_shadowsocks
{
cp /etc/shadowsocks/shadowsocks.json ./config/shadowsocks
}
function backup_proxychains
{
cp /etc/proxychains.conf ./config/proxychains/
}
# backup all gnome settings
function backup_gnome_settings
{
dconf dump / >./config/gnome/gnome.config
# backup background and lock screen
background=$(gsettings get org.gnome.desktop.background picture-uri)
background=${background#"'"}
background=${background#"file://"}
background=${background%"'"}
lock=$(gsettings get org.gnome.desktop.screensaver picture-uri)
lock=${lock#"'"}
lock=${lock#"file://"}
lock=${lock%"'"}
cp $background ./config/picture/background.png
cp $lock ./config/picture/lock.png
# gtk backup
cp ~/.config/gtk-3.0/gtk.css ./config/gtk-3.0/gtk.css
}
function backup_firefox
{
echo
# to do
}
function backup_chrome
{
echo
# to do
}
function backup_ranger
{
cp ~/.config/ranger/* ./config/ranger/ -r
}
function backup_nautilus
{
cp ~/.config/nautilus/* ./config/nautilus/
}
function backup_touchpad
{
cp /etc/X11/xorg.conf.d/70-synaptics.conf ./config/touchpad/
}
function backup_uninstall
{
echo
# to do
}
function backup_other
{
# smaller bar
cp ~/.config/gtk-3.0/* ./config/gtk-3.0 -r
# font conf
cp ~/.font.conf ./config/font/.font.conf
# input method
cp ~/.config/fcitx/ ./config/ -r
rm ./config/sogou/* -rf
cp ~/.config/SogouPY ./config/sogou/ -r
rm ./config/sogou/SogouPY/*.bin ./config/sogou/SogouPY/sync -rf
cp ~/.config/SogouPY.users ./config/sogou/ -r
cp ~/.config/sogou-qimpanel ./config/sogou/ -r
}
function backup_synapse
{
cp ~/.config/synapse/config.json ./config/synapse/config.json
cp ~/.config/autostart/synapse.desktop ./config/synapse/
}
function backup_gitkraken
{
echo
# to do
}
function backup_inkscape
{
echo
# to do
}
function backup_libreoffice
{
echo
# to do
}