Skip to content

Doge-is-Dope/clockbar

Repository files navigation

ClockBar

Swift-native clock-in/out automation for 104 on macOS.

Features

  • Today's clock-in / clock-out status in the menu bar
  • Manual punch with macOS notifications
  • Scheduled auto-punch via launchd, skipping weekends and Taiwan public holidays
  • Late and missed-punch reminders
  • Optional Auto-punch after wake — if the Mac slept through a window, the app completes the punch when it wakes (still inside the on-time window)
  • Built-in 104 sign-in — no separate browser session needed
  • Optional wake-before-punch via pmset (one-time admin approval)
  • Launches at login

Requirements

  • macOS 15+
  • Xcode 16+

Install

git clone https://github.com/Doge-is-Dope/clockbar.git
cd clockbar
make install

To update:

git pull
make install

First run

  1. Click the ClockBar icon in the menu bar.
  2. Open Settings → Account and sign in to 104 in the built-in web view.
  3. In Settings → Automation, set your Clock-in window and Clock-out window. Auto-punch fires at a random time inside each window, on workdays, when the Mac is awake.
  4. Optionally enable Sleep & Wake → Wake Mac so the Mac wakes itself shortly before clock-in. macOS will prompt for admin once to install the pmset rule.
  5. Optionally enable Sleep & Wake → Auto-punch after wake so a punch the Mac slept through is completed automatically on the next wake — as long as it's still inside the on-time window.

If the Mac is asleep at the scheduled time and Auto-punch after wake is off, you get a Missed notification with a Punch Now button when it next wakes.

Pause auto-punch

touch ~/.104/autopunch-disabled

Delete the file to resume.

Diagnostics

State, logs, and a dry-run path live behind clockbar-helper:

./ClockBar.app/Contents/MacOS/clockbar-helper config
./ClockBar.app/Contents/MacOS/clockbar-helper status
./ClockBar.app/Contents/MacOS/clockbar-helper punch
./ClockBar.app/Contents/MacOS/clockbar-helper auto clockin|clockout [--dry-run]
./ClockBar.app/Contents/MacOS/clockbar-helper schedule install|remove|status [--force]
./ClockBar.app/Contents/MacOS/clockbar-helper schedule test install <clockin|clockout> <HH:MM> [--real] [--force]
./ClockBar.app/Contents/MacOS/clockbar-helper schedule test status
./ClockBar.app/Contents/MacOS/clockbar-helper schedule test remove [<clockin|clockout>] [--force]

schedule install / remove wait for any in-flight auto-punch to finish before tearing down launchd jobs. Pass --force to interrupt a stuck run.

Logs: ~/.104/clockbar.log.

Development

make menubar      # build and launch
make uninstall    # remove from /Applications, unload launchd jobs
make status       # launchd state + recent auto-punch log lines
make clean

Configuration file

The Settings window writes ~/.104/config.json. Edit it directly only if you need to:

{
  "schedule": {
    "clockin": "09:00",
    "clockin_end": "09:15",
    "clockout": "18:00",
    "clockout_end": "18:15"
  },
  "min_work_hours": 9,
  "missed_punch_notification_enabled": true,
  "missed_punch_notification_delay": 0,
  "autopunch_enabled": true,
  "autopunch_on_wake_enabled": false,
  "wake_enabled": false,
  "wake_before": 300,
  "refresh_interval": 1800
}

missed_punch_notification_delay, wake_before, and refresh_interval are in seconds.

About

🕰️ Swift-native clock-in/out automation for 104 on macOS.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors