GithubHelp home page GithubHelp logo

activitywatch / activitywatch-old Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 2.0 143 KB

[DEPRECATED] :watch: Logs your computer activities, a RescueTime replacement.

License: MIT License

Python 86.10% HTML 8.92% JavaScript 4.98%

activitywatch-old'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.

Architecture

graph TD;
  aw-qt[<a href='https://github.com/ActivityWatch/aw-qt'>aw-qt</a>];
  aw-notify[<a href='https://github.com/ActivityWatch/aw-notify'>aw-notify</a>];
  aw-server[<a href='https://github.com/ActivityWatch/aw-server'>aw-server</a>];
  aw-webui[<a href='https://github.com/ActivityWatch/aw-webui'>aw-webui</a>];
  aw-watcher-window[<a href='https://github.com/ActivityWatch/aw-watcher-window'>aw-watcher-window</a>];
  aw-watcher-afk[<a href='https://github.com/ActivityWatch/aw-watcher-afk'>aw-watcher-afk</a>];
  aw-watcher-web[<a href='https://github.com/ActivityWatch/aw-watcher-web'>aw-watcher-web</a>];
  aw-sync[<a href='https://github.com/ActivityWatch/aw-server-rust/tree/master/aw-sync'>aw-sync</a>];

  aw-qt -- Manages --> aw-server;
  aw-qt -- Manages --> aw-notify -- Queries --> aw-server;
  aw-qt -- Manages --> aw-watcher-window -- Watches --> S1[Active window] -- Heartbeats --> aw-server;
  aw-qt -- Manages --> aw-watcher-afk -- Watches --> S2[AFK status] -- Heartbeats --> aw-server;
  Browser -- Manages --> aw-watcher-web -- Watches --> S3[Active tab] -- Heartbeats --> aw-server;
  SF -- Dropbox/Syncthing/etc --> SF;
  aw-server <-- Push/Pull --> aw-sync <-- Read/Write --> SF[Sync folder];
  aw-server -- Serves --> aw-webui -- Queries --> aw-server;

  %% User -- Interacts --> aw-webui;
  %% User -- Observes --> aw-notify;
  %% User -- Interacts --> aw-qt;

classDef lightMode fill:#FFFFFF, stroke:#333333, color:#333333;
classDef darkMode fill:#333333, stroke:#FFFFFF, color:#FFFFFF;

classDef lightModeLinks stroke:#333333;
classDef darkModeLinks stroke:#FFFFFF;

class A,B,C,D,E,G lightMode;
class A,B,C,D,E,G darkMode;

%% linkStyle 0 stroke:#FF4136, stroke-width:2px;
%% linkStyle 1 stroke:#1ABC9C, stroke-width:2px;
Loading

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!

activitywatch-old's People

Contributors

erikbjare avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

activitywatch-old's Issues

ZenobaseLogger dies when connection fails

Should catch the exception and add all events back to the queue, preventing loss of events.

For the record: It seems RescueTime has issues with lost connections as well. My connection died today at 8:57, a few minutes before this issue was opened I noticed it was no longer running. No activity after 9:00 had been reported. Restarting it only resumed logging and did not send the apparently lost events between crash and restart.

Log window titles along with window class

Useful for applications such as text editors where the open file/project is in the window title.

Also useful for things such as wine applications since all wine windows appear with the "wine" window class (at least that's what I'm guessing given the behavior in RescueTime).

RescueTime has this feature as well, so required for feature parity.

Build simple datastore module

Basically a combination of a Inflow Agent and a Logger.

Enables the ability to log events from remote hosts directly to a database (such as your laptop or phone). Currently I do this with Zenobase, which isn't a very privacy-conscious solution.

The API plans are documented here.

[X11Watcher] Error while updating active window

The following error happens when there might not be an active window (such as when switched to an empty workspace in xmonad). Switching to an empty workspace is not an error, but it's unlikely to be the only cause for the error.

2015-07-03 23:18:17,733 ERROR from X11Watcher: Error while updating active window, trying again.

Implement profiling

Would be nice with a --profiling argument that profiled everything in the program (or a specific agent/module).

Would help greatly in solving #22 and reducing similar issues in the future.

Trigger commands on events/activities

Such as:

when (AFK activity) started; then 
    run slock    # and maybe also sleep displays
done

It would be nice with some kind of systemd integration, if practical/"the way".

OS X support

This isn't high on my priority list since I don't use OS X, but might be a good idea to implement if we want to attract more devs. Shouldn't be too hard.

Handle signals and exit gracefully

This is a requirement for the first stable release.

This is a major issue in the current implementation as it currently just quits without sending off/saving events still in the pipeline, leading to data loss of recent events. It also adds significant complexities as the timing behavior for different agents is unknown. Some agents send events as they happen, others wait for them to complete. Some filter chains also wait for a certain time between handling events (to do chunking for instance).

The solution is intended to have good compatibility with systemd.

Questions

  • Which signal should be caught?
    • SIGTERM might be appropriate if exit can be done quickly.
    • SIGINT is appropriate because it's thrown when a user does Ctrl-c
  • Should we have daemon functionality?

Resources

I've gathered some resources here that are useful when implementing.

Chomium & Firefox plugins

Depends on a functioning REST API for creating Inflow Agents and adding events to them.

The API plans are documented here.

Better categorizing of events

Arbtt has some pretty neat features that allow this to be done in a post-processing step on the raw data.
A tool that does this for logs created by activitywatch would be nice.

arbtt website: http://arbtt.nomeata.de/#what
Here's a guide by gwern on effective use: http://arbtt.nomeata.de/doc/users_guide/effective-use.html

What should be done:

  • Investigate the storage format used by arbtt
  • See if any changes are appropriate for the Activity class
  • Build a tool that can analyse and filter activities much like arbtt-stats on data from external sources (json file, MongoDB database, etc.)

Reimplement X11Watcher

A reimplementation of the X11Watcher using xprop instead of the old Xlib wrapper library is needed. This was called for due to some issues with the current implementaion (see issue #22).

Rescuetime uses the xprop approach and it seems easier quite frankly.

This issue makes #22 irrelevant.

Feature list:

  • Log all open windows and their titles, allowing for watching of windows not in focus (for example gathering which song is played in Spotify etc.)
  • Collect WM_COMMAND, _NET_WM_NAME/WM_NAME and other attributes

Send computer name with events

This could be done in-agent, or by creating a new annotator agent and adding it to the pipeline.

The device name should be hostname by default, but should also be able to be set by the user in the config file.

Figure out a good way to build pipelines

Would probably be best done programmatically.

Would be nice to be able to create groups/chains/nets which have I_n inputs and O_n outputs, much like a neural net. These can then be instantiated as a group to be inserted in many pipelines (chunking + splitting is a common combination).

[X11Watcher] pid_property was None

The following error appears every now and then for certain windows.

2015-07-03 23:15:00,891 ERROR from X11Watcher: Exception was thrown while running loop: 'pid_property was None', trying again.

Which windows it happens for will be listed here:

  • Steam
  • Kerbal Space Program

The error message should be improved so the window title is included, makes for easier debugging and finding the windows that cause it.

The output from the X11 watcher could be improved in general.

Terminal logging

How can we do this effectively? Should we care at all?

  • zsh/bash-plugins?
  • zsh/bash history?
  • tmux activity monitoring?

Make logs available via REST

Logs for each agent (and all agents) should be made available via REST.
In the future WebSockets might be used instead.

This is done by creating a log handler that writes to buffers which can then be fetched from REST (probably done by subclassing NullHandler but unsure).

The first version can simply make the entire log available via REST and not support specifying the log of a particular agent.

100% CPU usage

On my system (Arch) ActivityWatch wants to use up 100% of available resources for the core it's running on.

Will have to investigate this, now I don't run it at all on my system because of this issue (since it makes my CPU fan remind me of it's existence).

[X11Watcher] Tags out of sync with current application

Saw this in the output today, is was pretty common in the log overall.

{
    "start": "2015-10-16T07:52:52.856971",
    "cmd": [
        "python",
        "/usr/share/backintime/kde4/app.py"
    ],
    "tags": [
        "app.py",
        "App.py"
    ],
    "end": "2015-10-16T07:52:54.871024"
},
{
    "start": "2015-10-16T07:52:54.870983",
    "cmd": [
        "/opt/google/chrome/chrome"
    ],
    "tags": [
        "app.py",
        "App.py"
    ],
    "end": "2015-10-16T07:53:20.554564"
}

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.