Skip to content

A MacOS status bar item to show today's screen time for roughly tracking work hours.

License

Notifications You must be signed in to change notification settings

pincheira/screentime

 
 

Repository files navigation

screentime

A MacOS status bar item to show today's screen time for roughly tracking work hours.

docs/screenshot.png

This is pretty much just an alternative display to System Preferencs/Screen Time. Uses macOS "Knowledge" SQLite database to find total app usage and displays in status bar with format of ##h ##m. Also, built without using xcode editor and only uses Swift Package Manager (SPM).

Tested on MacBook Pro M1 with macOS 12.6

Commands

# build
swift build

# run
swift run

Run on Startup

# screentime.applescript
do shell script "swift run --package-path $PATH_TO_REPO"
# compile AppleScript command to macOS app
osacompile -o ScreenTime.app screentime.applescript

Go to System Preferences > Users & Groups > Login Items, then press + and add ScreenTime.app.

Full Disk Access

Full Disk Access wasn’t always required to read the Screen Time (and related) databases on macOS. However, starting with macOS Catalina (10.15), Apple restricted access to these files. If you don’t grant Full Disk Access to both Applet (automatically listed when the app runs) and ScreenTime.app, you’ll encounter the “authorization denied (code: 23)” error. To avoid this, go to System Settings → Privacy & Security → Full Disk Access, and make sure both are enabled.

docs/screenshot.png

References

About

A MacOS status bar item to show today's screen time for roughly tracking work hours.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 96.6%
  • AppleScript 3.4%