Git Product home page Git Product logo

aw-import-screentime's Introduction

Records what you do so that you can know how you've spent your time.
All in a secure way where you control the data.


WebsiteForumDocumentationReleases
Contributor statsCI overview



Do you want to receive email updates on major announcements?
Signup for the newsletter!

Table of Contents

About

The goal of ActivityWatch is simple: Enable the collection of as much valuable lifedata as possible without compromising user privacy.

We've worked towards this goal by creating an application for safe storage of the data on the user's local machine and as well as a set of watchers which record data such as:

  • Currently active application and the title of its window
  • Currently active browser tab and its title and URL
  • Keyboard and mouse activity, to detect if you are AFK ("away from keyboard") or not

It is up to you as user to collect as much as you want, or as little as you want (and we hope some of you will help write watchers so we can collect more).

Screenshots

You can find more (and newer) screenshots on the website.

Installation & Usage

Downloads are available on the releases page.

For instructions on how to get started, please see the guide in the documentation.

Interested in building from source? There's a guide for that too.

Is this yet another time tracker?

Yes, but we found that most time trackers lack one or more important features.

Common dealbreakers:

  • Not open source
  • The user does not own the data (common with non-open source options)
  • Lack of synchronization (and when available: it's centralized and the sync server knows everything)
  • Difficult to setup/use (most open source options tend to target programmers)
  • Low data resolution (low level of detail, does not store raw data, long intervals between entries)
  • Hard or impossible to extend (collecting more data is not as simple as it could be)

To sum it up:

  • Closed source solutions suffer from privacy issues and limited features.
  • Open source solutions aren't developed with end-users in mind and are usually not written to be easily extended (they lack a proper API). They also lack synchronization.

We have a plan to address all of these and we're well on our way. See the table below for our progress.

Feature comparison

Basics
User owns data GUI Sync Open Source
ActivityWatch WIP, decentralized
Selfspy
ulogme
RescueTime Centralized
WakaTime Centralized Clients
Platforms
Windows macOS Linux Android iOS
ActivityWatch
Selfspy
ulogme
RescueTime Limited functionality
Tracking
App & Window Title AFK Browser Extensions Editor Plugins Extensible
ActivityWatch
Selfspy
ulogme
RescueTime
WakaTime Only for text editors

For a complete list of the things ActivityWatch can track, see the page on watchers in the documentation.

About this repository

This repo is a bundle of the core components and official modules of ActivityWatch (managed with git submodule). Its primary use is as a meta-package providing all the components in one repo; enabling easier packaging and installation. It is also where releases of the full suite are published (see releases).

Server

aw-server is the official implementation of the core service which the other ActivityWatch services interact with. It provides a REST API to a datastore and query engine. It also serves the web interface developed in the aw-webui project (which provides the frontend part of the webapp).

The REST API includes:

  • Access to a datastore suitable for timeseries/timeperiod-data
  • A query engine and language for such data

The webapp includes:

  • Data visualization & browser
  • Query explorer
  • Export functionality

Watchers

ActivityWatch comes pre-installed with two watchers:

  • aw-watcher-afk tracks the user active/inactive state from keyboard and mouse input
  • aw-watcher-window tracks the currently active application and its window title.

There are lots of other watchers for ActivityWatch which can track more types of activity. Like aw-watcher-web which tracks time spent on websites, multiple editor watchers which track spent time coding, and many more! A full list of watchers can be found in the documentation.

Libraries

  • aw-core - core library, provides no runnable modules
  • aw-client - client library, useful when writing watchers

Folder structure

Contributing

Want to help? Great! Check out the CONTRIBUTING.md file!

Questions and support

Have a question, suggestion, problem, or just want to say hi? Post on the forum!

aw-import-screentime's People

Contributors

abegong avatar erikbjare avatar konstanto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

konstanto abegong

aw-import-screentime's Issues

It seems not working anymore

When I ran poetry install it says

Installing dependencies from lock file

Could not parse version constraint: branch

Any ideas?

Preferred method for scheduling repeated execution?

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?

sqlite3.DatabaseError: authorization denied (knowledgeC.db protected 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.

Are these the right hostname and bucket name?

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.

Events are duplicated on each run?

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?

[$50 bounty] Automatic Phone Sync with iOS Screen Time API

Note: Definitely more than $50 of work; hoping others can chime in to make this not an insultingly bad offer.

Screen time API

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?

Use case

Mainly want this to back up screen time history longer than the current retention dates.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.