Skip to content

Instantly share code, notes, and snippets.

View mmyrte's full-sized avatar

Jan Hartman mmyrte

  • ETH Zürich
  • Zürich
View GitHub Profile
@mmyrte
mmyrte / README.md
Last active May 28, 2024 12:41
macOS: Screen Time data & Calendar Events to SQLite

Long Term Screen Time

Because the macOS knowledgeC.db only tails the last month of usage data, longterm analytics isn't possible. Here, a script triggered by LaunchAgent observing two sqlite DBs (knowledgeC and Calendar) inserts data into a persistent database. Use at your own peril.

In order for the script to have access to those system DBs, you need to give zsh full disk access.

Run the nice-application-names.sh manually to get a table of better names that are more legible than the com.apple.Safari identifiers.

Got inspired to do this by https://rud.is/b/2019/10/28/spelunking-macos-screentime-app-usage-with-r/.