Git Product home page Git Product logo

ttt's Introduction

Trivial time tracker

Free and Open Source minimalistic time tracker leveraging QubesOS VMs to categorize the tasks.

About

This tool is written for QubesOS, which separates all your activities into separate virtual machines (domains) in order to achieve security. As an interesting byproduct, it achieves nice organization of life as well. If the separation mechanism is used properly, there exists mapping from vm_name -> fun|work (or a more granular categorization). If the mapping doesn't seem to work for you, you've almost certainly mixed security domains that you shouldn't have mixed. :)

There are two notable edge cases: dom0, which can be considered neutral and dispX which has unpredictable name. DispVMs are currently prefixed by the name of their parents followed by colon to help with categorization, however, it's not that useful for dom0. Contributions to improve it welcome! (Ideas: ask about it or decide based on the template.)

Installation

  1. The tools are written in Rust. sudo apt install cargo or sudo dnf install should be sufficient. Build it by separately entering the directories cli, qubes_rpc and running cargo build --release. Binaries are in target/release/
  2. Copy the RPC service binary into /usr/local/etc/qubes-rpc/ttt and cli tool into /usr/local/bin/ttt of the VM that will handle the incoming data. It should be a VM that you launch often, of course.
  3. Securely copy the time track script into dom0 and review that it doesn't do anything malicious. Configure the VM you want to use, then set it up to run automatically. (Menu -> System tools -> Session and Startup -> Application Autostart)
  4. Launch the tracking script in dom0 or reboot the computer

Usage

Stats

After collecting some data you can run ttt stats today to see todays statistics. Other options include:

  • ttt stats yesterday
  • ttt stats this week
  • ttt stats this month
  • ttt stats this year
  • ttt stats BEGIN
  • ttt stats BEGIN END

Where BEGIN and END is any string that can be parsed as local date/time by chrono

Groups

You can group VMs in order to simplify the output of stats:

  1. Create a group by running ttt group create GROUPNAME (e.g. ttt group create fun)
  2. Add VMs to the group by running ttt group addvms GROUPNAME VMS ... (e.g. ttt group addvms fun games social-networks)
  3. After running ttt stats ... you'll see the VMs grouped. They currently can't be "ungrouped" ping me or make a PR, if you need it.

Troubleshooting

In case something seems wrong, inspect the log file in ~/.local/share/ttt/qubes_rpc.log

Contributions and planned features

I'll be happy to accept contributions, especially to the CLI tool!

Wanted features

  • Filter VMs
  • Groups of VMs (sometimes it's useful to separate an activity into several qubes - e.g. work between each client/project)
  • Handle edge-cases like going to sleep, turning off the computer, turning off tracking VM
  • Have more information about dispvm launched by dom0
  • Allow merging output of ttt stats for dispvms
  • Combine with other sources of events (smartphone, manual entry)
  • Allow editing/overriding the records
  • Proper documentation (man page etc)
  • Shell completion
  • Pre-compute statistics, if needed (not sure how it'll behave after recording many events)
  • Cleanup and documentation of the Rust code

Known issues

UNIQUE constraints are violated sometimes, IDK how's that possible. Some events/VMs seem to be lost. - Looks like I messed up replacing the binaries after fixing the issue keeping it here until better tested.

License

MITNFA

ttt's People

Contributors

kixunil avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ttt's Issues

Examples

According to @Zaijo it'd be helpful to have some examples in the README.

Count switching

Switching between tasks is detrimental to "deep work" and focus. It'd be great to count switches, but we need to make sure to avoid counting switching between vms that are associated with the same task. This can be achieved by groups, once implemented.

Improve dealing with nights

When the computer goes to sleep it still logs some VM as active. This leads to weird results when this week is used.

Qubes has a hook for before sleep events. It'd be helpful to write sleep as a special VM, and maybe have a special button/shortcut for explicit time off (register a special event and ignore events during following 5 sec).

Time limits

Sometimes it's hard to keep track of time, so a notification after spending too much time in e.g. group fun would help.

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.