Coder Social home page Coder Social logo

wtl's Introduction

wtl - when to leave build status

Tells when to leave work.

Synposis

wtl [-c <config>] [<time=HH:MM>]
wtl -h <hours> [<time=HH:MM>]

Build and Install

To install wtl to /usr/local/bin simply invoke make:

$ make && make install

Options

When invoked without arguments, wtl tries to load the default configuration from the home directory and sets <time> to the current time if not already configured for today.

  • -c <config>: Uses the working hours configuration <config>, defaults to ~/.wtl
  • -h: Defines how many hours should be added to <time>

Configuration

The configuration file is used to set working hours for different days of the week. There must be only one key=value per line. Consecutive configurations overwrite previous ones.

The following configuration keys are available:

  • all days: **
  • all working days (mon - fri): *
  • individual days: sun, mon, tue, wed, thu, fri, and sat

Furthermore, the following keys will be written by wtl and should not be manually set:

  • initial starting time: started
  • day of the week: wday

Example Configuration

Suppose, you need to work 37.5 hrs per week, take a 50 min lunch break and want to spend less time at the office on fridays, you could use something like this:

*=8:50
fri=6:20

Examples

Using with default configuration

$ date "+%H:%M"
08:27

$ wtl # Use the current time
You need to work until 17:17
Started: 08:27

$ # ...

$ date "+%H:%M"
11:53
$ wtl # Any subsequent calls use the configured time
You need to work until 17:17
Started: 08:27

Explicit hours configuration

$ wtl -h 8:50 09:00 | grep until | cut -d" " -f6 # 8:50 hrs working time
17:50

Custom configuration file

$ date "+%H:%M"
08:11

$ wtl -c ./my-working-hours
You need to work until 14:41
Started: 08:11

wtl's People

Contributors

jazzschmidt avatar

Stargazers

Ewout van Mansom avatar Cornelius Wichering avatar

Watchers

 avatar

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.