Giter Site home page Giter Site logo

workday's Introduction

workday

Keep track of how long you have worked and the amount of flex time you have

Installation

  • Install python

  • Download this repo and cd to it

  • pip install .

  • Add a config file with "days_file: <location of days file>".

Default location for the config file is ~/.config/workday.yaml on linux and %USERPROFILE%\workday.yaml on windows

The days file contains all the data and should be backed up.

Usage

workday.py -w Shows a summary

workday.py --start-day 07:30 Sets your start of day to 07:30

workday.py --lunch 11:30 12:00 Sets your lunch to 11:30-12:00

workday.py --end-day 16:00 Sets your end of day to 16:00

workday.py -l Logs todays data to the days file

Automation

These instructions are suggestions on how to automate the input of times

Linux

Use cron to log and reset the day log, for example:

0 18 * * * /home/marhag87/.virtualenvs/workday/bin/python /home/marhag87/git/workday/workday/workday.py -l

0 0 * * * /home/marhag87/.virtualenvs/workday/bin/python /home/marhag87/git/workday/workday/workday.py -r

Use a script to trigger your lock, or look for it in some way. For example:

# Assume locking screen ends the day
/home/marhag87/.virtualenvs/workday/bin/python /home/marhag87/git/workday/workday/workday.py --end-day
# Don't fork i3lock
i3lock -n
# Assume unlocking starts the day, but don't edit if it's not 0
/home/marhag87/.virtualenvs/workday/bin/python /home/marhag87/git/workday/workday/workday.py --start-empty-day
# If you unlock, the day has not ended. Reset it
/home/marhag87/.virtualenvs/workday/bin/python /home/marhag87/git/workday/workday/workday.py --reset-end

Windows

Windows can use the Task Scheduler to trigger the jobs.

Use the following triggers and actions:

  • On workstation lock: run script with "--end-day"
  • On workstation unlock: run script twice, once with "--start-empty-day" and once with "--reset-end"
  • Before midnight: run script with "-l"
  • At midnight: run script with "-r"
  • At system startup: run script twice, once with "--start-empty-day" and once with "--reset-end"
  • At system shutdown: run script with "--end-day"

System shutdown is not a normal trigger. You can use "on event" with Log: System, Source: User32, Event ID: 1074

If you use a laptop, don't forget to untick "Start the task only if the computer is on AC power" under Conditions, Power.

workday's People

Watchers

 avatar  avatar  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.