Time Manager (tm) is a CLI written in Rust for managing and tracking time spent on specified activities. It outputs a csv file with this data. Time is measured in 10ths of an hour (i.e. six minutes).
Clone this repository into a specified directory.
git clone https://github.com/pauljickling/time-manager.git
After you have installed, change into the directory and run:
cargo build --release
This will install an optimized build of the platform.
For ease of use, I recommend creating an alias in your .bashrc file.
alias tm='$HOME/path/to/target/release/tm'
Where path/to
is the location you installed the time-manager files.
If you have never modified a .bashrc file before you can read about it in Linux Command Line Fourth Internet Edition by William Shotts. You can acquire a free copy of the book here, and the relevant information can be found in Chapter 11.
Time manager accepts two parameters in this order: tm {action} {activity}
.
tm start {activity}
creates a new csv file with the specified activity.
tm stop {activity})
creates a stop record entry for the csv file and adds up the total time spent on the activity since the last entry was recorded.
tm resume {activity}
creates a resume entry for the csv file.
tm list
displays the names of all the created csv files. Also accepts tm ls
.
tm view {activity}
displays the contents of a particular csv file.
tm help
lists valid syntax for the Time Manager.
Of course if you have not specified an alias you will need to type in cargo run
in the correct directory instead.
The {activity}
specified will be the name of the csv file.
The following uses of Time Manager are errors that will cause the program to complain:
- Using tm with no specified parameters
- Using an invalid action parameter
- Using start as an action parameter for an activity that already exists
- Using an action parameter that was the last used action for an activity
Note that using a resume
action after start
is considered a benign bug, and Time Manager will not complain about it.
The csv files contain four fields:
- The specified action
- A time/date stamp
- A Unix timestamp
- Total hours spent on that activity
Time Manager creates a directory in your default Documents directory called tm_activity
where all the files are written.
Time Manager has been tested on MacOS and Linux.