WorkTimeUtil is a small command-line tool to read working hours from your calendar, sum them up, and push them to absence.io. It provides a convenient way to manage your working hours without manual calculation.
You can install WorkTimeUtil using Homebrew by running:
brew tap emanuelmairoll/homebrew-tap
brew install worktimeutilWorkTimeUtil has three main commands: calculate, push, and config.
Calculate working hours for a specific time period.
worktimeutil calculate [W|W<n>[/<yy>]|M|M<n>[/<yy>]]Arguments:
W: Current weekW<n>: Week numbernW<n>/<yy>: Week numbernof the yearyyM: Current monthM<n>: Month numbernM<n>/<yy>: Month numbernof the yearyy
There is also a shorthand provided:
wtc [W|W<n>[/<yy>]|M|M<n>[/<yy>]]Push working hours to absence.io for a specific time period.
worktimeutil push [W|W<n>[/<yy>]|M|M<n>[/<yy>]]Arguments are the same as for the calculate command.
There is also a shorthand provided:
wtp [W|W<n>[/<yy>]|M|M<n>[/<yy>]]Set configuration values.
worktimeutil config [key] [value]key: The configuration key to set (e.g.,absenceIOCreds).value: The value to set for the specified key.
You can set the following configuration values:
absenceIOCreds: Set your absence.io API credentials in the format<ID>:<KEY>. This is required for thepushcommand.workHoursPerWeek: Set your expected work hours per week. The default value is 38.5.removeLunchBreak: Set totrueto remove lunch break duration from working hour calculation, orfalseto include it. The default value isfalse.