aboutsummaryrefslogtreecommitdiff
path: root/.config/khard/config_gen
diff options
context:
space:
mode:
Diffstat (limited to '.config/khard/config_gen')
-rwxr-xr-x.config/khard/config_gen25
1 files changed, 25 insertions, 0 deletions
diff --git a/.config/khard/config_gen b/.config/khard/config_gen
new file mode 100755
index 0000000..75f59b1
--- /dev/null
+++ b/.config/khard/config_gen
@@ -0,0 +1,25 @@
+#!/bin/sh
+EXPORT_LIB=y . "$XDG_CONFIG_HOME/vdirsyncer/config_gen"
+
+cat << EOF
+[addressbooks]
+
+EOF
+
+_cfg_dav() {
+ [ "$DAV_TYPE" != "carddav" ] && return
+ jq --raw-output '.collections[][0]' "$VDIRSYNCER_STATUS_PATH/$ID.collections" | while read -r collection ; do
+ collection_path="$XDG_DATA_HOME/vdirsyncer/$ID/$collection"
+ displayname_path="$collection_path/displayname"
+ NAME="$(cat "$displayname_path")"
+ cat << EOF
+[[$NAME]]
+path = "$collection_path"
+EOF
+ echo
+ done
+}
+
+. "$CONFIG_FILE"
+
+printf '# %s:%s=%s\n' vim ft dosini