9

I want to be able to access the Evolution calendar from the command line. Specifically, I'd like to be able to:

  1. List calendar events (the one-line summary, date and time is enough)
    1. Upcoming events starting today
    2. Events on a specific date
  2. Add an event on a specific date

How can I do that? Is it possible?

Google was distinctly unhelpful in this case. I'm running Evolution 3.4.4. Using additional software packages that talk to the Evolution server is perfectly fine.

user
  • 28,161
  • 13
  • 75
  • 138
  • what is your calendar server type ? it's very unlikely that evolution allow such a thing or maybe by reading it's files – Kiwy Feb 14 '14 at 14:47
  • @Kiwy I have no idea. How do I find out? I just installed Debian's `evolution` package plus dependencies (including evolution-data-server) and created a couple of calendars in the Evolution GUI. The only thing I can say reasonably for sure is that they are not "web" calendars of any kind. I *think* they are termed "local" or something like that, but am not in front of that system to check. – user Feb 14 '14 at 14:51
  • You can also refer to https://developer.gnome.org/platform-overview/stable/tech-eds.html.en whoch sound like the exact thing you need to handle your calendar – Kiwy Feb 14 '14 at 15:03
  • @Kiwy Um, what's pointed at by those links looks like API documentation to me. Is there anything in particular there that you have in mind which might help me, or are you saying I have to roll my own? – user Feb 14 '14 at 15:04
  • derbian eshell was a shot, but not the right one. – Kiwy Feb 14 '14 at 15:05
  • @Kiwy Here's something, though. The tech-eds link points toward `libecal`, and some digging resulted in me trying `apt-cache rdepends libecal-1.2-11` which prints the names of a bunch of packages (those which *depend on* that libecal package). Some of them obviously don't help me, but some *might*; I'm not in a position of really being able to check them out right now, but I'll see if I can't do it later today and see if anything useful turns up. Thanks for the pointer so far! – user Feb 14 '14 at 15:10
  • Are you looking for a Debian specific solution? If so, you should add a debian-tag to your question. – Nils Feb 19 '14 at 10:23
  • @Nils I am looking for a solution that works on Debian. I'd much *prefer* if it also worked on other distributions, or at least can be adapted to work on other distributions. – user Feb 19 '14 at 14:33
  • The user data seem to be stored in `~/.local/share/evolution`. I don't know, but you could see if they are in a (human) readable format. – Donarsson Mar 05 '14 at 22:34

2 Answers2

0

The answer to your question is SyncEvolutiuon. The documentation for the Command Line usage is on the website

SyncEvolution synchronizes personal information management (PIM) data via various protocols (SyncML, CalDAV/CardDAV, ActiveSync). It syncs contacts, appointments, tasks and memos. It syncs to web services or to SyncML-capable phones via Bluetooth.

You can then use this to access your Evolution Calendar by getting the information sync to CalDAV. Good blog on this is Degooglifying Part IV

The best thing is that you can use this to sync your calendar to many devices or just so you can bang on CalDAV with any script.

Raphael Ahrens
  • 9,701
  • 5
  • 37
  • 52
mtelesha
  • 1,121
  • 1
  • 7
  • 7
0

As said in another answer, syncevolution.

Here is an example: assuming you have an email in your Evolution mail client, this example will export the calendar events

ACCOUNT='[email protected]'
ACCOUNT_ID=`syncevolution --print-databases | grep $ACCOUNT | awk '{print($2)}' | sed 's/[\(|\)]//g'`
syncevolution --export - backend=evolution-calendar database=$ACCOUNT_ID

Then you can parse the output.

Some notes about the script:

  • I sent the output to STDOUT with --export. You can send straight to a file, etc.
  • There is no need to programmatically get the account id, just use the print-databases command to select whatever account id you need and then export it.
Emilio
  • 111
  • 5