mail: Add calcurse vdir import function
Wrapped calcurse into function that imports all external calendar events on startup. Does NOT yet export anything added in calcurse to the outside world again, for now khal is required for that.
This commit is contained in:
parent
ff2cbe7e2d
commit
593628b81d
1 changed files with 27 additions and 0 deletions
27
mail/.config/sh/alias.d/calcurse-vdir.sh
Normal file
27
mail/.config/sh/alias.d/calcurse-vdir.sh
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/env sh
|
||||||
|
#
|
||||||
|
# Wraps around the calcurse invocation and syncs calendar data
|
||||||
|
# to local vdir - given by default below.
|
||||||
|
#
|
||||||
|
# For now ONLY PROVIDES ONE-WAY Synchronization, see below.
|
||||||
|
|
||||||
|
# The path in which *the calendars* reside (i.e. toplevel with access to all paths)
|
||||||
|
CAL_PATH="$HOME/documents/calendars"
|
||||||
|
|
||||||
|
calcurse() {
|
||||||
|
find "$CAL_PATH" -maxdepth 1 -type d -exec calcurse-vdir import {} \;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Enable two-way sync. One issue is that calcurse would sync everything
|
||||||
|
# into the top-level path (or the selected calendar path) since it makes
|
||||||
|
# not the same differentiation as the vdir between calendars.
|
||||||
|
# FIXME Not sure how to resolve currently.
|
||||||
|
#
|
||||||
|
# The below works as a simple two-way synchronization on exiting calcurse.
|
||||||
|
# To function the invocation has to be turned from a function above to an
|
||||||
|
# executable shell-script file instead.
|
||||||
|
# trap 'calcurse_export' 0
|
||||||
|
#
|
||||||
|
# calcurse_export() {
|
||||||
|
# calcurse-vdir export "$CAL_PATH"
|
||||||
|
# }
|
Loading…
Reference in a new issue