Coder Social home page Coder Social logo

otto-aa / aw-watcher-terminal Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 1.0 77 KB

Terminal watcher for the free open-source tracking tool ActivityWatch

Home Page: http://activitywatch.net/

License: Mozilla Public License 2.0

Makefile 1.68% Python 98.32%
activitywatch activitywatch-watcher self-tracking

aw-watcher-terminal's Introduction

No Maintenance Intended

aw-watcher-terminal [Unmaintained]

Extension to ActivityWatch which allows you to track the commands you've written and time spent in terminals.

Build Status


Features

Tracking commands and metadata

Automatically track following data for every command execution:

  • the executed command
  • path of the shell
  • shell name
  • exit code of the command
  • execution time
  • session id (automatically created)

Tracking activity time

For simpler analysis on how long you've worked in the terminal (and in which directories and paths) this data is stored in a separate bucket. Following data is tracked there:

  • shell name
  • path
  • session id

Restoring specific terminal sessions (Not implemented yet)

With the data stored it is theoretically possible to write all commands executed in a specific terminal session into a file. This feature is not yet implemented.


Installation

Prerequisites

You need to have ActivityWatch installed.

Install aw-watcher-terminal

git clone https://github.com/otto-aa/aw-watcher-terminal.git
cd aw-watcher-terminal
make build

Install the appropriate watcher for your shell

If your preferred shell is missing, feel free to file an issue or create the shell watcher on your own (see docs).

Start aw-watcher-terminal

# If the aw-server is not started yet (e.g. by aw-qt), then start it in a separate terminal
aw-server
# Start the terminal watcher
aw-watcher-terminal

Currently, you can pass it the flags --testing for using the test server and --verbose for more detailed logging

Note: If you want it to autostart with aw-qt, take a look at this this issue

Open a new terminal and start executing commands

echo "Finished installation"

aw-watcher-terminal's People

Contributors

otto-aa avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jackenmen

aw-watcher-terminal's Issues

Enhance documentation

  • General information about aw-watcher-terminal (what it tracks; some link to activitywatch)
  • Standards for the individual events (args; order of execution; necessity of events)
  • Documentation on how to create a new shell-specific watcher (fifo-path; string escaping; async)
  • Contributing
  • Code of conduct
  • License

Add a PID file so only one instance of aw-watcher-terminal is needed

Seems to me like you currently start a aw-watcher-terminal instance for each terminal which is opened. Since you are using one-way communication via fifo-files multiple instances should not be needed.

I am suggesting to use the activity watch data dir (.local/share/activitywatch/aw-watcher-terminal on linux, accessible via aw-core.dirs.get_data_dir) for both the fifo-file and a pid-file. Then we can check every time aw-watcher-terminal starts if a aw-watcher-terminal process is already running and if it is we can simply just utilize that instance and its fifo-file instead. This should also fix issues on multi-user systems when you have the fifo file in /tmp.

Send heartbeats on activity

Whenever an event is triggered, the watcher should send a heartbeat to the server so one can easily track the time spent in terminals.

Data to send:

  • process id
  • shell
  • path

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.