khal
khal copied to clipboard
Allow configuring a `picker_cmd` for picking a collection
Problem
When I run khal import, khal renders a list of all calendars in a long wrapped line with a number after each one. Visually scanning through over a dozen calendars to find the right one isn't very comfortable.
Tentative solution
I would prefer to use fzf to pick a calendar (e.g.: execute an external command for picking). I suppose others may want to write their own picker, but I suspect that fzf is good enough for all cases.
In order to use fzf (or any other picker), we need a picker_cmd configuration option. khal writes all calendar displaynames to this program's stdin, the program prints back the selected calendar (or exits non-zero if non was selected).
As an end result, when importing, I'd just type per to fuzzy-match the calendar personal, without having to scan through several calendars in order to figure out that personal is 8.
Not entirely sure what to do by default. Keep the current picker?
Additional notes
When importing events, the calendar selection UI should hide calendars with are meant to contain todos (and not events). A vdir currently does not encode this information, but it is planned for future.