tblancher's timetracker timekeeping system
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
5.0 KiB

11 months ago
  1. # timetracker INSTALL
  2. There are some things that you need to do in order to use timetracker like a pro. Here are the basics:
  3. 1. Install Keyboard Maestro from the MSC. If it is not available to you, send a helpdesk request to helpdesk@pindrop.com to request it. Install it using the standard MSC method.
  4. 1. Launch Keyboard Maestro. Two pieces should launch, the Editor and the Engine. If the Engine is loaded you should see the ![Keyboard Maestro icon][KM_icon] in your toolbar.
  5. 1. In the Keyboard Maestro Editor, select ![File/Import Macros Safely...][import_menu]. Import the `timetracker.kmmacros` file into Keyboard Maestro. All imported macros will be disabled by default.
  6. 1. Enable the "Insert Timestamp Begin" and "Insert Timestamp End" macros: ![Begin/End][enable_macros]. To select multiple macros hold down the "Command" ('⌘') and click each desired macro. Then click "Enable or Disable Macro" at the bottom of the Keyboard Maestro Editor window, in the center pane under "Macros".
  7. * If desired, you can modify the trigger for these macros at this time: ![Change Trigger][change_trigger]. You'll have to do this for each macro individually.
  8. * As imported, the Begin and End macros are triggered by: ⌘+Shift+D
  9. 5. You can repeat the above process for the "Insert Date (ISO 8601 format)" macro, which will allow you to quickly type out today's date in ISO-8601 date standard formate (e.g., "2020-04-07").
  10. 1. Now that you have the basic Begin and End macros imported and enabled, you can begin using them. In your favorite terminal emulator (e.g. iTerm2 or Terminal.app), open vim on today's log file:
  11. ```
  12. cd ~/timetracker
  13. vim 2020-04-07.log
  14. ```
  15. Or, if you prefer, use gvim or Mac vim GUI programs.
  16. 7. If you haven't already, copy the .vimrc file from the timetracker GitHub repository to your home directory (`/Users/<username>/`, or `~/`). If you already have a .vimrc file that has your own customizations in it, consider adding the following line to your .vimrc:
  17. ```
  18. nmap Y y$
  19. ```
  20. If you do not do this you will have to modify the vim macro (see below).
  21. 8. The Keyboard Maestro macros make use of the `@a` vim macro. To record it in vim:
  22. * Press `q`, then release, and then type `a`. You should now see `recording @a` in the vim status line at the bottom of your vim window.
  23. * Press Escape (`Esc`) to go into normal/command vim mode (where you can navigate with `hjkl` keys).
  24. * If you are using the timetracker .vimrc, or have made the suggested edit to your own .vimrc, type the following keys:
  25. ```
  26. klYjp
  27. ```
  28. * If you are not using the timetracker .vimrc, and have not made the suggested edit to your own .vimrc, type the following commands instead:
  29. ```
  30. kly$jp
  31. ```
  32. * Press `q` again to stop recording the macro.
  33. * Trigger the vim macro by typing `@a` (the "Insert Timestamp End" macro does this automatically)
  34. What these vim macros do is copy the category and task name from the above line (should be a Begin task), and paste it to the end of the End line. This should eliminate any mistakes when setting the end time of a task. Note that if a mistake is made on the Begin line, that mistake will be propagated to the End line when the "Insert Timestampt End" macro is executed.
  35. 9. Both the "Insert Timestamp Begin" and "Insert Timestamp End" macros automatically press the Escape key (`Esc`), so you can trigger them from normal/command mode, or insert mode. In vim, trigger the "Insert Timestamp Begin" macro by typing `⌘+Shift+D`, then `B` (or whatever you changed the trigger to be). If you haven't changed the trigger, a ![Conflict Dialog][conflict_dialog] will pop up, where you can choose the desired macro (either with your mouse, or by typing `B` for Begin, or `E` for End).
  36. 1. If you have chosen the "Insert Timestamp Begin" macro, you can type a category (`[In Square Brackets]`), then the title of the task you are beginning. Note that the title is free form, but having square brackets in the title, outside of the category is untested. Any other characters should be valid.
  37. 1. When you're finished with the task, run the "Insert Timestamp End" macro. You should see the timestamp with the "End" keyword, and the category and title of the above Begin task copied verbatim. Then the macro will automatically print another Begin line, ready for the next task.
  38. Reach out to me (Trey Blancher, tblancher@pindrop.com), if you have questions or problems with this procedure. Or better yet, file an issue under the timetracker repository on GitHub.
  39. [KM_icon]: https://github.atl.pdrop.net/tblancher/timetracker/tree/master/images/KM_icon.png
  40. [import_menu]: https://github.atl.pdrop.net/tblancher/timetracker/tree/master/images/import_menu.png
  41. [enable_macros]: https://github.atl.pdrop.net/tblancher/timetracker/tree/master/images/enable_macros.png
  42. [change_trigger]: https://github.atl.pdrop.net/tblancher/timetracker/tree/master/images/change_trigger.png
  43. [conflict_dialog]: https://github.atl.pdrop.net/tblancher/timetracker/tree/master/images/conflict_dialog.png