icalBuddy
repository·master·Indexed 41 days ago
https://github.com/ali-rantakari/icalbuddyA command-line utility for macOS that allows users to query the OS X calendar database to extract lists of events and tasks. It provides features for filtering by date ranges, customizing output formatting, and managing localization.
What's inside icalBuddy
- icalBuddy is a command-line utility designed to extract lists of events and tasks/to-do's from the macOS (OS X) calendar database. It accesses the same data source used by the native iCal application.
Configure localization for icalBuddy
masterTo use icalBuddy in a language other than English, copy one of the included example localization files to
~/.icalBuddyLocalization.plist.cp [example_localization_file] ~/.icalBuddyLocalization.plistEdit the icalBuddy configuration file
masterTo customize output formatting (like colors or bullet points), you must edit the configuration file. You can open the editor directly from the terminal using the
editConfigcommand.Note: It is recommended to have OS X developer tools (XCode) installed so the Property List Editor can be used to edit the file.
/usr/local/bin/icalBuddy editConfigInstall icalBuddy to a custom location
masterBy default, icalBuddy installs to
/usr/local. To install to a different prefix (e.g., your home folder):- Run
install.command. - Choose the
coption ("change installation path"). - Enter your desired prefix (e.g.,
~/local).
With a prefix of
~/local, the executable will be at~/local/bin/icalBuddyand manual pages at~/local/share/man/man1.Important: If you use a custom location, you must add the new paths to your
PATHandMANPATHenvironment variables in your shell configuration file (e.g.,~/.bashrcor~/.zshrc):export PATH=${PATH}:/Users/username/local/bin export MANPATH=${MANPATH}:/Users/username/local/share/man- Run
Install icalBuddy
masterTo install icalBuddy on macOS, locate the
install.commandfile in the distribution and double-click it in Finder. This will launch a Terminal script that displays the intended installation locations and prompts you to confirm the installation.Double-click `install.command` in FinderInstall or uninstall icalBuddy
masterThe icalBuddy distribution archive includes scripts for installation and uninstallation. You can run
install.commandto install oruninstall.commandto remove the application by double-clicking them in Finder or executing them via the Terminal.# Run via terminal ./install.command ./uninstall.commandFilter events by Calendar UID
masterIf you have multiple calendars with the same name (common with Exchange), use the
-ic(--includeCals) or-ec(--excludeCals) arguments with the calendar's unique identifier (UID) instead of the name.To find the UIDs for your calendars, run:
icalBuddy calendars.# List calendars to find UIDs $ icalBuddy calendars # Example output showing UID • Calendar type: Exchange UID: 3F0B97F7-0B88-48E3-BDAB-977382767D28 # Use the UID to include a specific calendar icalBuddy -ic 3F0B97F7-0B88-48E3-BDAB-977382767D28Access icalBuddy documentation and manual pages
mastericalBuddy provides several ways to learn how to use the utility and configure it:
- Command-line arguments: Run
man icalBuddyin the terminal to view the manual page containing all available arguments. - Configuration file: Run
man icalBuddyConfigin the terminal to learn about the configuration file format and how to customize icalBuddy's behavior. - Localization: Run
man icalBuddyLocalizationin the terminal to learn how to write your own localizations. - FAQ: Open the
faq.htmlfile in a web browser for additional guidance. - PDF versions: Manual pages are also available as PDF files within the distribution.
- Command-line arguments: Run
Use relative dates for event ranges
masterAs of version 1.7.13, you can specify relative dates in arguments to fetch events relative to the current date.
Supported relative dates:
day before yesterdayyesterdaytodaynowtomorrowday after tomorrow
You can apply a 'day shift' by appending
+NUMor-NUMto these keywords (e.g.,tomorrow+1for the day after tomorrow).For high-precision requirements, use the format
YYYY-MM-DD HH:MM:SS ±HHMM.# Get events for tomorrow icalBuddy eventsFrom:tomorrow to:tomorrow # Get events for tomorrow and the day after tomorrow icalBuddy eventsFrom:tomorrow to:'day after tomorrow'Localize icalBuddy
masterTo use a custom language, copy a localization file from the
exampleLocalizationFilesdirectory in the distribution archive to your home folder and name it.icalBuddyLocalization.plist.Example: Setting up French localization
cp exampleLocalizationFiles/french-icalBuddyLocalization.plist ~/.icalBuddyLocalization.plistFix 'Address book access is denied' error
masterIf you see an error stating
Address book access is denied for executable at path..., it means icalBuddy lacks permission to access your contacts.Option 1: Grant Permission Go to System Preferences > Security & Privacy > Privacy, select Contacts, and check the box next to icalBuddy.
Option 2: Suppress Errors If you do not want to grant access, redirect stderr to
/dev/nullin your command:/usr/local/bin/icalBuddy -sd eventsToday+10 2>/dev/nullCall icalBuddy from other programs (e.g., GeekTool)
masterIf icalBuddy is not found, it is likely not in your
PATH.For standard shells: Add the installation directory (default
/usr/local/bin) to yourPATHin your shell config file:export PATH=$PATH:/usr/local/binFor GeekTool: GeekTool does not load shell configuration files. You must either:
- Use the absolute path to the executable:
/usr/local/bin/icalBuddy <arguments> - Explicitly source your shell configuration in the command:
source ~/.bashrc; icalBuddy <arguments>
source ~/.bashrc; icalBuddy <arguments>- Use the absolute path to the executable: