Giter Site home page Giter Site logo

screen-on-time's Introduction

screen-on-time

A simple script to check how long you have actively used (e.g. display turned on) your MacBook since the last full charge.

How to use

You can run this script without downloading it (thanks @hotrungnhan):

curl -s https://raw.githubusercontent.com/DudeNr33/screen-on-time/main/src/screen_on_time.py | python3 -s

Or just download the file src/screen_on_time.py, make it executable via chmod +x screen_on_time.py and run it in your terminal: ./screen_on_time.py. It is compatible with Python 3 and works without any additional dependencies. This means even if you are unfamilar with Python, you should be able to run it with just the instructions given above (assuming you know how to use a terminal).

Disclaimer

The script relies on parsing the output of pmset -g log. This means that if those log messages change in the future or are different in the version of macOS you are running, the script will fail. Feel free to open an issue here on GitHub if you have problems. Please attach the output of pmset -g log in to ease the analysis of the problem.

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.