Git Product home page Git Product logo

ett-c's Introduction

Eye Time Tracker: C version

Overview

This is a small C program that will try to regulate your computer screen time by auto locking your computer after a certain set time. It will then auto unlock your computer after another set time (called the cooldown period).

It is actually a slightly more advanced rewrite of the first program I ever released publicly. That version was written in Python.

Notifications will be given when the computer is being locked so that you won't be blindsided by the auto lock.

Note: on some laptops, the laptop may suspend itself after being locked for some time. The program currently doesn't have a way to wake the computer up from sleep like this, so make sure the cooldown period isn't too long.

PLEASE NOTE: macOS and Windows are NOT SUPPORTED! This is a Linux only program due to the dependencies outlined below

Dependencies

In order to send notifications, libnotify has to be installed. It's available in almost all Linux distributions. Note: for Fedora while testing this program, I had to install libnotify-devel for the program to work. I'd recommend installing an equivalent on other distros as well

For the auto locking and unlocking, loginctl is used, which is a way to interact with systemd's login service. So, systemd is also required.

Installation

You can simply compile the program as such (note: only gcc has been tested to work)

make

Then, run ett

It will prompt you to set the time for the working and cooldown periods, then it will keep running and will accordingly take action.

Roadmap

  • Make a config file so that the working and cooldown periods don't need to be entered every time

  • Make ett a systemd service that can be started on boot for a particular user

  • Add macOS and Windows support; this one is trickier since I don't really have a Mac to test my program with

  • Use C libraries for locking system instead of executing shell commands with system()

ett-c's People

Contributors

gotlougit avatar

Watchers

 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.