summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2024-02-16 02:05:51 +0100
committerAki <please@ignore.pl>2024-02-16 02:05:51 +0100
commitb4fb2a19abb556bae5def910eaeed05e4dd1e109 (patch)
treed2f9cd353a2113f02344f17e3eec6e3ac080c6ac
parentf7d7a7b3d82cd01ef8bf66948c2c66f3398b437a (diff)
downloaddots-b4fb2a19abb556bae5def910eaeed05e4dd1e109.zip
dots-b4fb2a19abb556bae5def910eaeed05e4dd1e109.tar.gz
dots-b4fb2a19abb556bae5def910eaeed05e4dd1e109.tar.bz2
Added sendemail git config
Also a helper script for synchronizing the dots
-rw-r--r--.config/git/config5
-rwxr-xr-xdots57
2 files changed, 62 insertions, 0 deletions
diff --git a/.config/git/config b/.config/git/config
index 9304359..ee3725c 100644
--- a/.config/git/config
+++ b/.config/git/config
@@ -3,3 +3,8 @@
name = Aki
[init]
defaultBranch = master
+[sendemail]
+ smtpencryption = tls
+ smtpserver = mail.ignore.pl
+ smtpuser = aki
+ smtpserverport = 587
diff --git a/dots b/dots
new file mode 100755
index 0000000..532e6c7
--- /dev/null
+++ b/dots
@@ -0,0 +1,57 @@
+#!/bin/bash
+shopt -s globstar nullglob dotglob
+REPO="$(realpath "$(dirname "$0")")"
+
+
+ignored() {
+ case $1 in
+ .gitignore|dots|.git|.git/*) return 0;;
+ *) return 1;;
+ esac
+}
+
+
+get() {
+ for file in **; do
+ ignored "$file" && continue
+ [ -f "$HOME/$file" ] && cp "$HOME/$file" "$REPO/$file"
+ done
+}
+
+
+put() {
+ for file in **; do
+ ignored "$file" && continue
+ if [ -f "$HOME/$file" ]; then
+ diff "$REPO/$file" "$HOME/$file" >/dev/null 2>/dev/null && continue
+ cp "$HOME/$file" "$HOME/$file.bak.$(date +%Y%m%d)"
+ fi
+ cp "$REPO/$file" "$HOME/$file"
+ done
+}
+
+
+clear() {
+ for file in **; do
+ ignored "$file" && continue
+ for bak in "$HOME/$file".bak.*; do
+ rm "$bak"
+ done
+ done
+}
+
+
+list() {
+ for file in **; do
+ ignored "$file" || echo "$file"
+ done
+}
+
+
+case $1 in
+get) get;;
+put) put;;
+clear) clear;;
+list) list;;
+*) exit 1;;
+esac