Giter VIP home page Giter VIP logo

worktime_helpers's Introduction

Worktime Helpers

Introduction

Some work places and contracts require employees to "clock" a given number of work hours.

As it so happened I used to work in one of these, and I found it a bit hard to keep track of the hours. So I wrote a couple of small helpers to register and monitor the work hours.

Structure

This repo includes 2 parts:

  1. A python script intended to run as a service or otherwise be run on system start-up (for instance added in: gnome-session-properties).

    This script runs dbus-monitor (so be sure it's reachable on system path) and writes the first screen unlock and last lock of each day into a csv file.

  2. A gnome-shell extension to display the remaining time to work this month.

Installation

Run python lockscreen_monitor.py (I recommend to run it on start up to avoid forgetting to run it).

Place the extension where gnome-shell can find it, e.g:

~/.local/share/gnome-shell/extensions/

Enable the extension, easily done using a toole such as: gnome-tweak-tool

Customization

lockscreen_monitor.py:

  • CSV_FILE = '~/hours_logs/{}.csv' - where you want to store the logs.
  • PID_FILE = '/tmp/lockscreen_monitor.pid' - where to store the pid file (to allow only 1 instance to run simultaniously).

extension.js:

  • REFRESH_INTERVAL = 120 - update frequency
  • SHOW_BLINKING = false - toggle blinking dot on every update
  • REQUIRED_HOURS_DAY = 9 - how many hours are required per work day
  • WEEKEND_DAYS = [5, 6] - which days of the week are weekends (0-6 where 0 = sunday)

worktime_helpers's People

Watchers

Pavel Savchenko avatar James Cloos 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.