Thanks to visit codestin.com
Credit goes to Github.com

Skip to content
/ busy Public

Private, local sync of personal calendar events to work calendar.

License

Notifications You must be signed in to change notification settings

welpo/busy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Busy Calendar Private Sync

A script to sync your personal calendar to your work calendar with "Busy" blocks, preserving privacy.

Features

  • 🔒 Privacy-preserving: Only syncs "Busy" blocks, no personal event details
  • 🌍 Travel-friendly: Uses fixed work timezone regardless of where you create events
  • Fast: Handles thousands of events efficiently using EventKit
  • 🥷 Stealth mode: Uses Cyrillic "Вusy" to distinguish from manual "Busy" events
  • 📅 Smart overlap detection: Handles multi-day and recurring events
  • 🔄 Bidirectional: Creates missing events AND removes outdated ones

Quick Start

  1. Download the script:

    curl -O https://raw.githubusercontent.com/welpo/busy/main/busy
    chmod +x busy
  2. Edit configuration (top of script):

    PERSONAL_CALENDAR = "Personal"        # Your personal calendar name
    WORK_CALENDAR = "Work"                # Your work calendar name
    WORK_TIMEZONE = "America/New_York"    # Your work timezone
    WORK_START = "09:00"                  # Work start time
    WORK_END = "17:30"                    # Work end time
    SKIP_MULTIDAY_EVENTS = False          # Skip events spanning multiple days

    To figure out your computer's timezone, visit dst.osc.garden and check the footer for your timezone string (e.g. "Europe/London").

  3. Run it:

    ./busy --dry-run    # Preview changes
    ./busy              # Actually sync

You can schedule syncs with cron or launchd. Example to sync every 20 minutes, in crontab -e:

*/20 * * * * /path/to/busy >> /path/to/busy.log 2>&1

How it works

  1. Reads your personal calendar for upcoming events (next 2 weeks by default)
  2. Filters events that overlap with your work hours in your work timezone
  3. Creates "Busy" events in your work calendar for those time slots
  4. Removes old "Busy" events that no longer have corresponding personal events

Requirements

Command-Line Options

./busy --dry-run     # Preview changes without making them
./busy --weeks 3     # Sync 3 weeks ahead instead of default 2
./busy --help        # Show configuration and help

FAQ

Q: What if I manually add "Busy" blocks to my work calendar?

A: You can change the AUTO_BUSY_TITLE constant to something else (e.g. "Work Busy") to avoid conflicts. By default, it uses "Вusy" (Cyrillic B) to distinguish from manual "Busy" events.

Q: Does this work across timezones when travelling?

A: Yes! Events are always compared against your fixed work timezone, so creating an event in Tokyo at 6 PM will sync if it falls during your NY work hours.

Q: What about all-day events?

A: All-day events will create "Вusy" blocks for the entire day (not just work hours).

Q: What about multi-day events (vacations, travel)?

A: By default, multi-day events are synced and create busy blocks for their entire duration. Set SKIP_MULTIDAY_EVENTS = True to skip these events entirely.

Q: Is it safe to run multiple times?

A: Yes, it's idempotent. Running it again will only sync changes since the last run.

Troubleshooting

"Calendar 'X' not found": Check your calendar names in Calendar.app and update the constants.

Permission denied: Grant Calendar access when prompted by macOS.

Wrong timezone: Verify WORK_TIMEZONE matches your work location (e.g. "America/New_York", "Europe/London").

License

This script is free software: you can redistribute it and/or modify it under the terms of the GNU general public license as published by the free software foundation, either version 3 of the license, or (at your option) any later version.

About

Private, local sync of personal calendar events to work calendar.

Topics

Resources

License

Stars

Watchers

Forks

Languages