aboutsummaryrefslogtreecommitdiff
path: root/backup
diff options
context:
space:
mode:
authorMarvin Borner2020-06-14 16:41:35 +0200
committerMarvin Borner2020-06-14 16:41:35 +0200
commit9ce9e64fb688161b7aa09d2c82bde010000b8368 (patch)
treeb6a6f3b85d9f850aa2a1a6e2858df41353f833b0 /backup
parent88565e120f0564f2354925617a83f1496353bb8d (diff)
Added new sync process via external dir
Diffstat (limited to 'backup')
-rwxr-xr-xbackup20
1 files changed, 17 insertions, 3 deletions
diff --git a/backup b/backup
index d47b5cf..ecfa89a 100755
--- a/backup
+++ b/backup
@@ -1,10 +1,17 @@
#!/usr/bin/env bash
+printf "\033[0;31m"
+if [ -z "$HOME" ] || ! [ -x "$(command -v pacman)" ]; then
+ echo "Something went wrong!"
+ printf "\033[0m"
+ exit 1
+fi
+
printf "\033[0;34m"
echo "Cleaning previous configs"
-rm -rf .config/ .repos/ .scripts/ .boilerplates/
-mkdir -p .config/{dunst,qutebrowser,gtk-2.0,gtk-3.0,nvim,zathura,mpv,spicetify} .repos
+rm -rf .config/ .repos/ .scripts/ .boilerplates/ .etc/
+mkdir -p .config/{dunst,qutebrowser,gtk-2.0,gtk-3.0,nvim,zathura,mpv,spicetify}/ .etc/X11/xorg.conf.d/ .repos/
echo "Copying configs"
@@ -22,6 +29,10 @@ cp "$HOME"/.config/mpv/mpv.conf .config/mpv/
cp "$HOME"/.config/uncrustify.cfg .config/
cp -r "$HOME"/.config/spicetify/{config.ini,Themes/} .config/spicetify/
+# Root configs
+cp /etc/logid.cfg .etc/
+cp /etc/X11/xorg.conf.d/* .etc/X11/xorg.conf.d/
+
# Inits
cp "$HOME"/.bash_profile "$HOME"/.bashrc "$HOME"/.xinitrc "$HOME"/.Xresources .
cp -r "$HOME"/.lein .
@@ -30,6 +41,7 @@ cp -r "$HOME"/.lein .
cp -r "$HOME"/.boilerplates .
# Crypto keys etc.
+printf "\033[0;34m"
echo "Uploading keys"
scp -rq "$HOME"/.crypto/ root@10.0.0.33:/mnt/ssd/
@@ -40,9 +52,11 @@ find .repos/ -type d -name ".git" -exec rm -rf {} +
find .repos/ -type f -exec sh -c "file -i '{}' | grep -q 'charset=binary'" \; -delete
# Installed programs
+printf "\033[0;34m"
echo "Getting package list"
-pacman -Qqe > packages.txt
+pacman -Qqe >packages.txt
+printf "\033[0;34m"
printf "\nChanged files:\n"
printf "\033[0;32m"
git status -s | cut -c4-