dotfiles

:)
git clone https://git.sr.ht/~ashymad/dotfiles
Log | Files | Refs | Submodules | LICENSE

commit c047e0c72519b782c7bd966835ba0e7ae2b5a95b
parent 39575cfa04428970700e835856c7724f9090a07a
Author: Ashymad <czilukim@o2.pl>
Date:   Sun, 18 Nov 2018 21:13:50 +0100

Configure astroid for isync

Diffstat:
M.gitmodules | 3+++
Mastroid/.config/astroid/config | 8++++----
Aastroid/.config/astroid/get_pass.py | 18++++++++++++++++++
Aastroid/.config/astroid/kpxcnm | 1+
Mastroid/.config/astroid/poll.sh | 65++++++++++++++++++++++++++++++++++++-----------------------------
5 files changed, 62 insertions(+), 33 deletions(-)

diff --git a/.gitmodules b/.gitmodules @@ -1,3 +1,6 @@ [submodule ".juliamodules"] path = julia/.juliamodules url = git@github.com:Ashymad/JuliaModules +[submodule "astroid/.config/astroid/kpxcnm"] + path = astroid/.config/astroid/kpxcnm + url = git@github.com:Ashymad/kpxcnm diff --git a/astroid/.config/astroid/config b/astroid/.config/astroid/config @@ -112,15 +112,15 @@ "accounts": { "o2": { "name": "Szymon Mikulicz", - "email": "czilukim@o2.pl", + "email": "szymon.mikulicz@posteo.net", "gpgkey": "", "always_gpg_sign": "false", "sendmail": "msmtp -i -t", "default": "true", "save_sent": "true", - "save_sent_to": "\/home\/shyman\/.mail\/o2\/Sent\/cur\/", - "additional_sent_tags": "o2", - "save_drafts_to": "\/home\/shyman\/.mail\/o2\/Drafts\/cur\/", + "save_sent_to": "\/home\/shyman\/.mail\/posteo\/Sent\/cur\/", + "additional_sent_tags": "posteo", + "save_drafts_to": "\/home\/shyman\/.mail\/posteo\/Drafts\/cur\/", "signature_separate": "false", "signature_file": "", "signature_file_markdown": "", diff --git a/astroid/.config/astroid/get_pass.py b/astroid/.config/astroid/get_pass.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +from os import path +import configparser +import sys + +import kpxcnm +from nacl.public import PrivateKey + +config = configparser.ConfigParser() +config.read(path.expanduser("~/.config/astroid/keys.ini")); + +k = kpxcnm.Kpxcnm(PrivateKey(kpxcnm.Kpxcnm._from_b64_str(config['DEFAULT']['privkey'])), + config['DEFAULT']['dbid']) + +k.change_public_keys() +if k.test_associate(True): + print(k.get_logins(sys.argv[1])[0]['password']) diff --git a/astroid/.config/astroid/kpxcnm b/astroid/.config/astroid/kpxcnm @@ -0,0 +1 @@ +Subproject commit d4ed23b64be17f939fbfc802a94924ae39fbe992 diff --git a/astroid/.config/astroid/poll.sh b/astroid/.config/astroid/poll.sh @@ -1,37 +1,44 @@ #!/usr/bin/env bash -MAILDIR="/home/shyman/.mail" - -if ! nc -z 127.0.0.1 19455; then - keepassxc & - exit -else - case $(curl -sd '{"RequestType":"test-associate","TriggerUnlock":true}' http://127.0.0.1:19455 | wc -w) in - - 0) exit - ;; - *) - ;; - esac -fi - -notmuch search --output=files tag:deleted and tag:o2 and not folder:o2/Trash | xargs -I {} mv -f "{}" $MAILDIR/o2/Trash/cur/ -notmuch search --output=files tag:deleted and tag:freeos and not folder:freeos/Trash | xargs -I {} mv -f "{}" $MAILDIR/freeos/Trash/cur/ -notmuch search --output=files tag:deleted and tag:agh and not folder:agh/Trash | xargs -I {} mv -f "{}" $MAILDIR/agh/Trash/cur/ - -offlineimap +set -e + +export MAILDIR="/home/shyman/.mail" + +moveIt() +{ + s=${1##*/} + s=${s%%,*} + mv -f $1 $2/$s + true +} +export -f moveIt + +#notmuch search --output=files tag:deleted and tag:o2 and not folder:o2/Trash | xargs -I {} mv -f "{}" $MAILDIR/o2/Trash/cur/ +#notmuch search --output=files tag:deleted and tag:freeos and not folder:freeos/Trash | xargs -I {} mv -f "{}" $MAILDIR/freeos/Trash/cur/ +#notmuch search --output=files tag:deleted and tag:agh and not folder:agh/Trash | xargs -I {} mv -f "{}" $MAILDIR/agh/Trash/cur/ +notmuch search --output=files tag:deleted and tag:posteo and not folder:posteo/Trash | xargs -I{} bash -c 'moveIt "{}" $MAILDIR/posteo/Trash/new/' + +# +o2 tag:new and path:"o2/**" +#+freeos tag:new and path:"freeos/**" +# +agh tag:new and path:"agh/**" +# +deleted tag:new and folder:o2/Trash or folder:freeos/Trash or folder:agh/Trash +# +sent tag:new and folder:o2/Sent or folder:freeos/Sent or folder:"freeos/Sent Items" or folder:agh/Sent +# +spam tag:new and folder:o2/Spam or folder:freeos/Spam or folder:freeos/Junk or folder:agh/Spam +# +inbox tag:new and folder:o2/INBOX or folder:freeos/INBOX or folder:agh/INBOX +# +archive tag:new and folder:o2/INBOX.Archive or folder:freeos/Archive or folder:agh/Archives +# +draft tag:new and folder:o2/Drafts or folder:freeos/Drafts or folder:agh/Drafts + +mbsync posteo notmuch new notmuch tag --batch <<EOF - +o2 tag:new and path:"o2/**" - +freeos tag:new and path:"freeos/**" - +agh tag:new and path:"agh/**" - +deleted tag:new and folder:o2/Trash or folder:freeos/Trash or folder:agh/Trash - +sent tag:new and folder:o2/Sent or folder:freeos/Sent or folder:"freeos/Sent Items" or folder:agh/Sent - +spam tag:new and folder:o2/Spam or folder:freeos/Spam or folder:freeos/Junk or folder:agh/Spam - +inbox tag:new and folder:o2/INBOX or folder:freeos/INBOX or folder:agh/INBOX - +archive tag:new and folder:o2/INBOX.Archive or folder:freeos/Archive or folder:agh/Archives - +draft tag:new and folder:o2/Drafts or folder:freeos/Drafts or folder:agh/Drafts + +posteo tag:new and path:"posteo/**" + +deleted tag:new and folder:posteo/Trash + +sent tag:new and folder:posteo/Sent + +inbox tag:new and folder:posteo/Inbox + +draft tag:new and folder:posteo/Drafts + +note tag:new and folder:posteo/Notes + +migration tag:new and folder:"posteo/Migration_*" EOF notmuch tag -new tag:new