trackit: A command-line tool for live monitoring

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

trackit is a command-line tool that listens for changes in a user-supplied directory. Whenever there is a change, a custom command is executed and its standard output is shown live in the terminal.

Examples

Show a live listing of the files in the current directory:

> trackit --watch-dir=. --command="ls --color"

Show a live revision graph of a Git repository:

> GIT_DIR=`git rev-parse --git-dir`
> trackit --watch-tree=$GIT_DIR --command="git log --graph --all --oneline --decorate --color"

For more information, see the README.


[Skip to Readme]

Properties

Versions 0.1, 0.1, 0.2, 0.2.1, 0.3, 0.4, 0.5, 0.6, 0.6.1, 0.6.2, 0.6.3, 0.7, 0.7.1, 0.7.2, 0.7.3
Change log None available
Dependencies base (>=4.10 && <4.11), brick, fsnotify, mtl, optparse-generic, process, process-extras, stm, text, time, vty [details]
License BSD-3-Clause
Copyright 2018 Emil Axelsson
Author Emil Axelsson
Maintainer 78emil@gmail.com
Category Development
Source repo head: git clone https://github.com/emilaxelsson/trackit.git
Uploaded by EmilAxelsson at 2018-03-10T12:27:50Z

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for trackit-0.1

[back to package description]

trackit

trackit is a command-line tool that listens for changes in a user-supplied directory. Whenever there is a change, a custom command is executed and its standard output is shown live in the terminal.

Examples

Show a live listing of the files in the current directory:

> trackit --watch-dir=. --command="ls --color"

Show a live revision graph of a Git repository:

> GIT_DIR=`git rev-parse --git-dir`
> trackit --watch-tree=$GIT_DIR --command="git log --graph --all --oneline --decorate --color"

Installation

trackit can be installed from Hackage using Cabal:

> cabal install trackit

Usage

Run trackit -h to get more information about available flags.

trackit starts a new buffer in the terminal and uses it to display the output of the command given as the --command flag. The display reacts to the following keyboard events:

When multiple changes occur in a short time in the watched directory (e.g. when switching branches in a repository), it may not be desired to have trackit react to every single change. This is especially the case if the monitored command is expensive (e.g. git log in a large repository). For this reason, trackit requires a stabilization period before running an update. If an event occurs during that period, the period clock is restarted and the update is delayed further.

The stabilization period can be set in milliseconds using the --stabilization flag. A lower value gives quicker response times, but increases the risk of getting spurious updates when a tight sequence changes occurs in the watched directory. The default stabilization period is 200 ms.

Comparison to watch

trackit offers two main advantages over the similar tool watch:

  1. trackit only reacts to file system changes. This avoids having to run a potentially costly command periodically. For example, the following command can easily consume a substantial part of your processor's cycles when run in a large repository:

    > watch -c -t -n 0,5 -- git log --graph --all --oneline --decorate --color
    
  2. trackit supports scrolling, and keeps the scrolled view even if the output is updated.