Skip to content

Instantly share code, notes, and snippets.

View j4mie's full-sized avatar

Jamie Matthews j4mie

View GitHub Profile
@j4mie
j4mie / workinghours.sh
Last active August 5, 2021 13:35
Plugin for xbarapp.com to display total time spent using your computer today
#!/usr/bin/env bash
# This query adds up the lengths of all the /app/usage events in ZOBJECT.
# This gives an approximation of how long the machine has been used for today, assuming
# the display goes to sleep fairly quickly when the machine is not used (eg 1 minute).
# You'll need to give xbar "Full Disk Access"
# (System Preferences -> Security and Privacy -> Privacy) for this to work.
DBPATH=~/Library/Application\ Support/Knowledge/knowledgeC.db