Git Product home page Git Product logo

wtime's Introduction

Actions Status

Wtime

This program gives you better control over your time at work by splitting work into manageable chunks of time. Conversely, you can use it to make sure your stand up and exercise regularly.

Introduction

Sitting for hours without a break in front of a computer is bad for your health and general wellbeing. Every thirty minutes or so, you might want to stand up and do a little bit of exercise so that you do not put too much strain on your spine and your body in general.

Splitting your work time into manageable chunks can give a better control over the time spent working so that you do not go out of focus or start doing overtime because you don't really now how long you've worked.

The program let's you control your time at work by splitting it into productive sessions followed by short breaks. Say, you might want to split your time into thirty-minute-long intervals with twenty-five minutes of work followed by a five-minute break. You sit back for twenty-five minutes, stay focused on a task and then you stand up, do some work that requires you to move, or if there is nothing else to do, then do a little bit of stretching, push-ups or whatever rocks your boat. You won't regret it.

How to use it?

You can use it and modify it however you like, but if I can suggest something, then I would stick to a very basic and non-intrusive usage.

All options that you can pass at the startup can be accessed with the --help flag.

First, you kick start the server:

wtime -work=25 -rest=5

You might want to pass your own alternating emoji to the -emojis parameter. There should be no more no less but two of them.

It is all happening on the same host, so there are no ports here, just Unix Domain Sockets (UDS). UDS-based implementation is faster and unambiguous. You grab a socket file and channel all the communication through this one file.

Then you can grab its output with netcat without any hassle or whatever:

nc -U /tmp/wtime.sock

Or you can put it on your tmux status line, for example, with this line:

set -g status-right "#(nc -U /tmp/wtime.sock) %A, %B %-e, %Y, %-l:%M:%S%p"

You can try and use some of that cat magic and dial in to the socket in loops to get a counter for work time followed by a moment of respite.

Development setup

There isn't much going on here for Go as all tools ship with the compiler. All core commands are specified in the Makefile.

Development environment

You might want to install the package to see how it works:

make install

Make sure your Go environment is properly set up, but this is something that you should take care on your own. There are many ways, and I am not elaborate on it here and now.

Testing

To run the test suite key in:

make test

# or

go test -v ./...

To build the binary:

go build --race -o bin/wtime main.go

You can do both things at once by typing bare make.

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.