-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopulate
executable file
·28 lines (24 loc) · 892 Bytes
/
populate
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
#!/bin/sh
readonly scriptpath="$(readlink -f "$0")"
readonly workdir="${scriptpath%/*}"
update() {
if [ -z "$1" ] || [ -z "$2" ]; then return 1; fi
if [ -f "$1" ] && [ -r "$1" ] && ! [ -L "$1" ] && ! cmp --silent "$1" "$2"; then
#echo ">>> Updating '$2' from '$1' ..."
cat "$1" > "${workdir}/$2"
else
return 1
fi
}
update /etc/dnsmasq.conf configs/dnsmasq.conf
update ~/.zshrc configs/DOTzshrc
update ~/.Xdefaults configs/DOTXDefaults
update ~/.config/tint2/tint2rc configs/tint2rc
update ~/.tmux.conf configs/DOTtmux.conf
update ~/.vimrc configs/DOTvimrc
update ~/.compton.conf configs/DOTcompton.conf
update ~/.gitconfig configs/DOTgitconfig && sed -r 's#(name|email) =.*#\1 = NULL#g;' -i configs/DOTgitconfig
update ~/.mpv/config configs/DOTmpv_slash_config
update ~/.xmodmap configs/DOTxmodmap
update ~/.config/user-dirs.dirs configs/user-dirs.dirs
git status --porcelain