Skip to content
/ acal Public

Check Apple calendar events from terminal on MacOS

License

Notifications You must be signed in to change notification settings

minho42/acal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Check Apple calendar events from terminal on MacOS using Swift

Create a new Xcode project

Xcode -> Create New Project... macOs -> Command Line Tool

Product Name: CalendarCLI

Select project in the navigator -> Targets: CalendarCLI -> Sining & Capabilities -> Signing

Bundle Identifier: [com.yoursite.CalendarCLI]

Make Info.plist

File -> New -> File from Template... [⌘ N] Search: "Property List" Save As: Info.plist

Select Info from navigator -> Open As > Source Code

Copy and paste from CalendarCLI/Info.plist to Info.plist

Code (main.swift)

Copy and paste from CalendarCLI/main.swift to main.swift

Build

Product -> Build [⌘ B]

The executable goes to something like:

~/Library/Developer/Xcode/DerivedData/CalendarCLI-epaeyjhibywlyqbuuhetpwnjddow/Build/Products/Debug/CalendarCLI

Run

Run the app $(find ~/Library/Developer/Xcode/DerivedData -name "CalendarCLI" -type f -path "/Build/Products/Debug/" -print -quit)

Run with alias

Make an alias in ~/.zshrc (for Z shell)

alias acal='$(find ~/Library/Developer/Xcode/DerivedData -name "CalendarCLI" -type f -path "_/Build/Products/Debug/_" -print -quit)'

Output

❯ acal
2024-11-24 (Sun)
· return books

2024-11-25 (Mon)
· 💰rent

About

Check Apple calendar events from terminal on MacOS

Topics

Resources

License

Stars

Watchers

Forks

Languages