From dc564c21ed905a3665b58e60e2eb94bf20e910f5 Mon Sep 17 00:00:00 2001 From: Nicolas Duhamel Date: Sun, 29 Apr 2018 13:39:18 +0200 Subject: [PATCH] Add vdirsyncer --- user/vdirsyncer/.config/vdirsyncer/config | 36 +++++++++++++++++++ user/vdirsyncer/.config/vdirsyncer/getpass.py | 10 ++++++ 2 files changed, 46 insertions(+) create mode 100644 user/vdirsyncer/.config/vdirsyncer/config create mode 100755 user/vdirsyncer/.config/vdirsyncer/getpass.py diff --git a/user/vdirsyncer/.config/vdirsyncer/config b/user/vdirsyncer/.config/vdirsyncer/config new file mode 100644 index 0000000..4d15882 --- /dev/null +++ b/user/vdirsyncer/.config/vdirsyncer/config @@ -0,0 +1,36 @@ +[general] +status_path = "~/.local/share/vdirsyncer/status/" + +[pair contacts] +a = "card_local" +b = "card_nextcloud" +collections = ["from a", "from b"] + +[storage card_local] +type = "filesystem" +path = "~/.local/contacts/" +fileext = ".vcf" + +[storage card_nextcloud] +type = "carddav" +url = "https://cloud.jombi.fr" +username = "nicolas" +password.fetch = ["command", "~/.config/vdirsyncer/getpass.py", "nicolas"] + +[pair calendars] +a = "cal_local" +b = "cal_nextcloud" +collections = ["from a", "from b"] + +[storage cal_local] +type = "filesystem" +path = "~/.local/calendars/" +fileext = ".ics" + +[storage cal_nextcloud] +type = "caldav" +url = "https://cloud.jombi.fr" +username = "nicolas" +password.fetch = ["command", "~/.config/vdirsyncer/getpass.py", "nicolas"] + + diff --git a/user/vdirsyncer/.config/vdirsyncer/getpass.py b/user/vdirsyncer/.config/vdirsyncer/getpass.py new file mode 100755 index 0000000..9e081c3 --- /dev/null +++ b/user/vdirsyncer/.config/vdirsyncer/getpass.py @@ -0,0 +1,10 @@ +#! /usr/bin/env python2 +import sys +from subprocess import check_output + + +def get_pass(account): + return check_output("pass nextcloud/" + account, shell=True).splitlines()[0] + +if __name__ == '__main__': + print get_pass(sys.argv[1])