GithubHelp home page GithubHelp logo

aw-watcher-vscode'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-watcher-vscode's People

Contributors

arushsharma24 avatar brunoparga avatar devzsolt avatar erikbjare avatar flaw avatar johan-bjareholt avatar michbart avatar otto-aa 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

aw-watcher-vscode's Issues

Duration is always zero

Seems like all the logged events have "duration": 0.0 stored. Might be related to issue #2

versions:

  • AW 0.8.0 beta 7
  • VSCode 1.29.1
  • aw-watcher-vscode 0.3.2

high severity vulnerability in a dependency: url-parse

                       === npm audit security report ===                        
                                                                                
# Run  npm update url-parse --depth 2  to resolve 1 vulnerability
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Open Redirect                                                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-parse                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ vscode [dev]                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ vscode > url-parse                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://nodesecurity.io/advisories/678                       │
└───────────────┴──────────────────────────────────────────────────────────────┘


Git branch name from VSCode is not sent

After installing the extension from VS Marketplace, I see no branch data being sent:
image

It seems that because PR #26 was merged without bumping the extension version, the Marketplace is still providing an old version. Here's the extension code that was installed locally where it can be seen that it doesn't include the code introduced by this PR:
image

I suspect that bumping the version and republishing to VS Marketplace would fix the issue, as the feature is there.

Inconsistency in tracked times

First of all, i don't know if I should post this here, or in the activitywatch repository, or in the forums.
Anyway, feel free to move the post where you think.

I have been using activity watch with vscode watcher for some time in addition to wakatime, and I have found the following inconsistencies.

Let's take today as an example.
First, in aw, the tracked (non afk) time for vscode is 52m, (1h20m total time with afk time)
code-aw

Then, the time tracked by vscode-watcher is 22minutes.
From those 22minutes, the time tracked by project is the following:
watcher

Now in wakatime, i know their heartbeats are more spaced than activitywatch, but their tracked time is pretty different. 1h47min in total, with this project time:
wakatime

Thanks for your time

Cannot read property 'duration' of undefined

ActivityView Version: v0.8.0b6

  | errorHandler | @ | Activity.vue:342
-- | -- | -- | --
  | (anonymous) | @ | Activity.vue:418
  | w | @ | runtime.js:65
  | (anonymous) | @ | runtime.js:299
  | t.(anonymous function) | @ | runtime.js:117
  | i | @ | asyncToGenerator.js:17
  | (anonymous) | @ | asyncToGenerator.js:28
  | Promise.then (async) |   |  
  | i | @ | asyncToGenerator.js:27
  | (anonymous) | @ | asyncToGenerator.js:35
  | e | @ | _export.js:35
  | (anonymous) | @ | asyncToGenerator.js:14
  | (anonymous) | @ | Activity.vue:407
  | editorBucketId | @ | Activity.vue:307
  | Ee.run | @ | vue.runtime.esm.js:3229
  | Ye | @ | vue.runtime.esm.js:2977
  | (anonymous) | @ | vue.runtime.esm.js:1833
  | qt | @ | vue.runtime.esm.js:1754
  | Promise.then (async) |   |  
  | Wt | @ | vue.runtime.esm.js:1802
  | Qt | @ | vue.runtime.esm.js:1846
  | (anonymous) | @ | vue.runtime.esm.js:3064
  | Ee.update | @ | vue.runtime.esm.js:3205
  | ut.notify | @ | vue.runtime.esm.js:693
  | (anonymous) | @ | vue.runtime.esm.js:840
  | (anonymous) | @ | Activity.vue:373
  | w | @ | runtime.js:65
  | (anonymous) | @ | runtime.js:299
  | t.(anonymous function) | @ | runtime.js:117
  | i | @ | asyncToGenerator.js:17
  | (anonymous) | @ | asyncToGenerator.js:28
  | Promise.then (async) |   |  
  | i | @ | asyncToGenerator.js:27
  | (anonymous) | @ | asyncToGenerator.js:35
  | e | @ | _export.js:35
  | (anonymous) | @ | asyncToGenerator.js:14
  | (anonymous) | @ | Activity.vue:369
  | mounted | @ | Activity.vue:326
  | Me | @ | vue.runtime.esm.js:2917
  | insert | @ | vue.runtime.esm.js:4154
  | L | @ | vue.runtime.esm.js:5956
  | (anonymous) | @ | vue.runtime.esm.js:6175
  | t._update | @ | vue.runtime.esm.js:2656
  | n | @ | vue.runtime.esm.js:2784
  | Ee.get | @ | vue.runtime.esm.js:3138
  | Ee | @ | vue.runtime.esm.js:3127
  | t | @ | vue.runtime.esm.js:2791
  | cn.$mount | @ | vue.runtime.esm.js:7995
  | t._init | @ | vue.runtime.esm.js:4636
  | cn | @ | vue.runtime.esm.js:4725
  | (anonymous) | @ | main.js:57
  | s | @ | bootstrap:76
  | n | @ | bootstrap:43
  | (anonymous) | @ | bootstrap:149
  | (anonymous) | @ | bootstrap:149


Use Specific Bucket Name per Window

I regularly work with multiple VS Code windows open at the same time with different projects. Most of the time they are separate VS Code Workspaces but sometimes just an opened folder and almost never a normal new window. Below are three examples of how this is shown in the window title:

Folder:
Screenshot from 2023-10-28 18-03-10

Workspace:
Screenshot from 2023-10-28 18-03-53

New Window:
Screenshot from 2023-10-28 18-05-26

The Watcher should always check if the current window is an opened worspace or folder and should make heartbeats accordingly. Otherwise the different heartbeats to the same bucket from different open windows would override each other which results in an unusable timeline, meaning very tiny activity "blips". (hostname pixelated):
Screenshot from 2023-10-28 18-11-24

These new buckets per project could be created automatically, but it would also be fine if an error shows that the bucket doesn't exist and the user needs to use the Reload ActivityWatch action manually.

Feature request: Send source control branch name along with the project name

Often times I work on a single project with different branches, it would be really convenient if the extension can track how much time i spent on each branch say.

master -> 10m
bugfix123 -> 20m
GH-112-fix-templates -> 30m

Note that usually the branch name has a prefix with an issue key from jira, github etc so it's really convenient for tracking how much time was spent on some issue (the editing part atleast).

watcher not running

Hello,
I have a aw-server running, and all seems working fine.
I have then installed the extension in vscode but in the aw web ui under "editor" i find nothing.
I'm using ubuntu 16.

Who owns the publisher on VS marketplace?

I noticed the extension slug had a weird username in it that I didn't recognize (https://marketplace.visualstudio.com/items?itemName=lindraupe.aw-watcher-vscode), and when I clicked it to get to the publisher I got a page that seemed very official: https://marketplace.visualstudio.com/publishers/lindraupe

However, I certainly don't have access to it, and I doubt @johan-bjareholt has either? I guess it might be @Otto-AA, which would be fair enough, but I'd like to know if that's the case or not.

Bug "Request error undefined" in ActivityWatch UI

I ran activitywatch-v0.8.0b6-windows-x86_64 and then opened VS Code v1.30.2 with the aw-watcher-vscode extension v0.4.0 enabled.

After that, I tried to access the ActivityWatch dashboard at http://localhost:5600/#/, tab Activity, and got this error:

image

This error was displayed in the browser's console output:

Activity.vue:342 TypeError: Cannot read property 'duration' of undefined
    at a.<anonymous> (Activity.vue:413)
    at w (runtime.js:65)
    at Generator._invoke (runtime.js:299)
    at Generator.t.(:5600/anonymous function) [as next] (http://localhost:5600/static/js/0.eb46a9d79636be6aeb56.js:107:16480)
    at i (asyncToGenerator.js:17)
    at asyncToGenerator.js:28

Also, data is not loaded correctly at the Editor tab, as you can see in this print:

image

The extension doesn't seem to be compatible with activitywatch-v0.8.0b6. Has anyone tested it with activitywatch-v0.8.0b7?

Totally unusable

So, I'm new to activity watch. As I heavily use vs code i installed this extension from the vscode extension marketplace.

Now as I installed for the first time this throws the following error:

[Extension Host] [ActivityWatch][handleError] Couldn't create Bucket. 
Please make sure the server is running properly and then run the [Reload ActivityWatch] command.

[Extension Host] Error: timeout of 10000ms exceeded	at createError 

Now, the server was already running, so I reload the extension, Now it throws this error:

Bucket already exists
[Extension Host] sendHeartbeat error:  undefined
[Extension Host] [ActivityWatch][handleError] Error while sending heartbeat

and keeps repeating this error until I disable the extension. I closed the vs code and opened again, to see the whole error cycle repeat again. So, I had to uninstall the extension. Is this project abandoned?

Using aw-watcher-vscode v0.4.0
AW v0.9.2
VS code 1.46

How to install for VSCodium

Don't see the extension on the marketplace while in VSCodium. Clicking "Install" on the marketplace page doesn't do anything. Any help is greatly appreciated!

EDIT: Possible duplicate of #11, but created a separate issue since I'm using VSCodium instead of official vscode.

[ActivityWatch] Error while sending heartbeat

Not much more information, Developer tools console has three related errors:

[ActivityWatch] Error while sending heartbeat
onDidChangeNotification @ /C:/Program Files/Mi…esktop.main.js:2855

[Extension Host] [ActivityWatch][handleError] Error while sending heartbeat
t.log @ /C:/Program Files/Mi…desktop.main.js:262

[Extension Host] sendHeartbeat error: undefined
t.log @ /C:/Program Files/Mi…desktop.main.js:262

But a lot of logs for seeming successful sends

console.ts:137 [Extension Host] Sent heartbeat Object

Couldn't create Bucket on WSL2

I installed ActivityWatch to Windows, but the extension running on WSL2 ubuntu tries to create Bucket to the not exist ActivityWatch on Ubuntu, then it shows the error message below.

[ActivityWatch] Couldn't create Bucket. Please make sure the server is running properly and then run the [Reload ActivityWatch] command.

Does not work using Remote - WSL (and presumably the other VSCode Remote variants)

This is already brushed upon over at #9, but I don't quite agree that it's purely a VSCode issue so I figured I'd create this to keep track of the work if we can figure out an easy fix.

The root of the problem is that the extension tires to connect to "localhost:5600", which works rather poorly when the extension is running on the remote extension host.
Luckily for us, an extension can choose on which extension host (local or remote) it runs on by specifying an extensionKind attribute in package.json, see https://code.visualstudio.com/api/advanced-topics/remote-extensions#incorrect-execution-location
So simply updating package.json and repackaging should take care of that.

I went ahead and used the remote.extensionKind configuration entry to force the extension to run on the UI side by adding

    "remote.extensionKind": {
        "lindraupe.aw-watcher-vscode": ["ui"]
    }

to user settings.json and ended up with the following:

image

As you can see it's already pretty promising, the only thing not working seemingly being the project entry.

I took a look at how _getProjectFolder() is implemented and my first guess is trying to pass a remote file Uri to workspace.getWorkspaceFolder() doesn't quite work in this case, so some alternative way of figuring out how we determine the project would be needed.
Perhaps one option could be to simply use workspace.name? As far as I can gather that'll return the name of the currently open folder, or undefined if we only have single files open. I'm unsure if that's sufficient from AW perspective or not.

For now I wasn't able to actually get the development environment running to test any code changes so the workspace.name solution is just guesswork, but I can try that again when I have some more time.

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.