activitywatch / aw-import-screentime Goto Github PK
View Code? Open in Web Editor NEWImport data from Apple's Screen Time on macOS and iOS to ActivityWatch
Import data from Apple's Screen Time on macOS and iOS to ActivityWatch
I don't want to have KDEWallet on my PC is there a way to bypass that somehow?
Getting this whenever I try to open the file.
Reading from database file at /Users/erb/Library/Application Support/Knowledge/knowledgeC.db
Traceback (most recent call last):
File "/Users/erb/Programming/activitywatch/other/aw-import-screentime/main.py", line 114, in <module>
main()
File "/Users/erb/Programming/activitywatch/other/aw-import-screentime/main.py", line 12, in main
conn = sqlite3.connect(_get_db_path())
sqlite3.DatabaseError: authorization denied
Some investigation...
$ ls -l /Users/erb/Library/Application Support/Knowledge/knowledgeC.db
-rw-r--r-- 1 erb staff 1.4M Feb 22 11:22 '/Users/erb/Library/Application Support/Knowledge/knowledgeC.db'
$ sudo cp '/Users/erb/Library/Application Support/Knowledge/knowledgeC.db' .
cp: cannot open '/Users/erb/Library/Application Support/Knowledge/knowledgeC.db' for reading: Operation not permitted
Not sure what's up, input appreciated.
main.py
looks like it's meant to be run as a cron job or within a daemon like supervisord
. Is that right?
Is there a preferred method for running scripts like this?
It seems like it'd be useful to use the ActivityWatcher application itself as the scheduler for scripts like this---especially if the goal is to make it easy for non-programmers to run additional Watchers as plugins. Is that something that could be in scope for the project?
Is there a naming convention for hostname
and bucket
?
I'm running this script from the same MacOs laptop that I run ActivityWatcher itself from. It seems odd that it creates a whole new hostname---none of the other Watchers I've tried so far does that. It also seems odd to mention "android", since I'm on Mac and an iphone.
Here's the relevant code in main.py
:
hostname = "macos-screentime-test"
# NOTE: 'aw-watcher-android' string is only there for aw-webui to detect it as a mobile device
bucket = f"aw-watcher-android_aw-import-screentime_{hostname}"
I'm new to the project, so I don't understand all the moving parts yet. But if you want to point me to documentation, I'd be happy to learn what I can and come back with a PR to improve things.
Thanks for what you're doing with AW! I've wanted something like this for years.
Every time I run main.py
it re-uploads all the events in knowledgeC.db
, resulting in many duplicates in the AW database.
I suspect this is an issue that other Watchers have needed to deal with, but I haven't been able to find documentation on it. Is there a typical pattern in AW for avoiding duplicated events when running insert_events
?
Note: Definitely more than $50 of work; hoping others can chime in to make this not an insultingly bad offer.
Introduced in iOS15, based on the WWDC21 Session, seems to be more of a parental control thing.
Checking out the API docs takes me to theDeviceActivity framework. Within that there's a DeviceActivityReport for iOS16+, with the following caveat:
sandbox prevents your extension from making network requests or moving sensitive content outside the extension’s address space
I checked Apple's Support forum and they recommended https://timingapp.com, but that didn't seem to be what I was looking for. There might be a workaround if the laptop and phone are connected via bluetooth, or maybe via iCloud, but I'm not sure what they'd be. I looked for usage on Github to see if something like this already exists but that doesn't seem to be the case.
I'm not sure if there's a way to do this without making a TestFlight app. There could be a hack from manually taking screenshots with ScreenCaptureKit and uploading that for an OCR, but that feels inelegant, and I'd probably forget to do it. Maybe Calendar and EventKit?
Mainly want this to back up screen time history longer than the current retention dates.
When I ran poetry install
it says
Installing dependencies from lock file
Could not parse version constraint: branch
Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.