Giter Club home page Giter Club logo

mutt-ical's Introduction

mutt-ical

This is a collection of scripts that make it easier to work with iCalendar files in mutt. (Note that this is for calendar information in the iCalendar file format. It has nothing to do with the OSX calendar program.)

viewical

viewical takes an iCalendar file on standard input and prints out a more human-friendly rendering of the data in the file. It's intended to be used as a display filter in mutt.

Requirements

Usage

This is easiest if you maintain a mutt-specific mailcap, e.g. having this in your ~/.muttrc:

set mailcap_path="${HOME}/.mutt/mailcap:/etc/mailcap"

In your mailcap, add entries for the appropriate MIME types:

text/calendar; /path/to/viewical; copiousoutput
application/ics; /path/to/viewical; copiousoutput

In your .muttrc, tell mutt to automatically display calendar data:

auto_view text/calendar
auto_view application/ics

Finally, you need to add (or modify) the alternative_order setting in your .muttrc to prefer iCalendar attachments over their HTML or text alternatives, for messages sent with such alternatives:

alternative_order text/calendar text/plain text/html

Output

Most of the script's output should be self-explanatory. Most fields are optional, so it'll only print information (from event end times to locations to event descriptions) if they're present in the original data.

One thing to note is the encoding of attendees (or, in iCalendar terminology, "participants"). They're presented in a list with a checkbox of sorts next to them, something like this:

[ ] Barb Example <[email protected]>

People will get different boxes depending on the role defined for them in the iCalendar data. The boxes are as follows:

  • { } - Event chairperson.
  • [ ] - Attendee, participation required. (Most programs use this as the default role.)
  • < > - Attendee, participation optional.
  • ( ) - Non-participant. (The author of these scripts has never seen this in actual use.)
  • _ _ - No role defined in the data.
  • ? ? - Unknown role.

The script places text in the box to indicate the status of the person. The statuses are as follows:

  • blank - Unknown. (Officially, this is "needs action", i.e. "waiting for a response".)
  • Y - Attending.
  • - - Not attending.
  • ~ - Maybe attending.
  • ? - Status not recognized by script.

(In the event that the iCalendar data does not define a status, the box will be empty, not just blank. This is "status unknown to organizer": [ ]. This is "status not present in data": []. That's not a huge difference, but every file the script's author has observed has had some status defined for every person attached to an event.)

Example

Here's an event with a chairperson, two required attendees, and two non-required attendees. The chairperson and one required attendee have responded that they will attend. The other required attendee has not yet responded. One of the non-required attendees will not attend and the other is tentative.

Organizer: Admin Aid <[email protected]>
Event:     Example Event
Date:      Thursday, August 4, 2016
Starts:    9:00 am
Ends:      10:00 am
Location:  Meeting Room 7
Attendees: {Y} Important Executive <[email protected]>
           [Y] Relevant Manager <[email protected]>
           [ ] Relevant Subordinate <[email protected]>
           <-> Affiliated Manager <[email protected]>
           <~> Irrelevant Manager <[email protected]>

ical-reply

ical-reply is intended to facilitate responses to iCalendar emails. It's not ready for use yet.

mutt-ical's People

Contributors

asciipip avatar deremperor avatar rohieb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

rohieb deremperor

mutt-ical's Issues

Assume END:VCALENDAR at the end when missing

I'm receiving broken ICS invites from Microsoft Teams that lack the ending 'END:VCALENDAR'. No comments...

This breaks the processing of the file, resulting in an exception.

I 'dirty fixed' this by synthesizing the missing END:VCALENDAR in cal.py, just to make it work (not suggeting this as a patch):

+++ b/cal.py	2023-12-11 11:33:52.273658512 +0100
@@ -323,10 +323,15 @@
         """
         stack = []  # a stack of components
         comps = []
+        seen_end_vcal = False
         for line in Contentlines.from_ical(st):  # raw parsing
             if not line:
                 if seen_end_vcal:
                     continue
+                else:
+                    line = Contentlines.from_ical('END:VCALENDAR')[0]
+
+            seen_end_vcal = line == 'END:VCALENDAR'
 
             try:
                 name, params, vals = line.parts()

Is it possible to add a fix for such broken files?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.