Giter Site home page Giter Site logo

awaken's Introduction

Awaken

A command line tool that prevents your Mac from going to sleep.

Description

awaken is a re-implementation of the caffeinate command line tool included in macOS. The project includes a libawaken.a static library to embed this behavior in other applications, like my macOS application KeepingYouAwake.

Installation

awaken can be built and installed using the.meson build system and a clang compiler that supports C++17 (e.g. from a recent Xcode version). For convenience an Xcode project file is also included.

meson build --buildtype=release
cd build
meson install
awaken —-help

Usage

awaken - prevents your Mac from going to sleep.
Usage:
  ./build/awaken [OPTION...]

  -d, --display-sleep    prevent the display from idle sleeping
  -s, --system-sleep     prevent the system from idle sleeping (default:
                         true)
  -t, --timeout N        timeout in seconds until the sleep assertion expires
                         (default: 0)
  -b, --battery-level N  a minimum battery level on devices with a built-in
                         battery that causes the sleep assertion to expire
                         (e.g. 20 for <= 20% remaining battery). Values above 95
                         are unreliable and depend on the battery health.
                         (default: 0)

 Help options:
  -h, --help     print this help
  -v, --version  print version information

Documentation

You can use doxygen (brew install doxygen) to generate the class documentation for this project.

Why Is This Written in C++17 Instead of C, Objective-C or Swift?

I started learning modern C++ a while ago and have never published a project in pure C++17 before using a modern build system I wanted to try: meson. I don’t rule out alternative implementations in C, Rust or Swift at all, it just depends on my own motivation to try these 😀.

Do you see any problems with my code or a potential optimization? Please create an issue or PR, I'm eager to learn 👍.

License

All files in this project are covered by the MIT license.

awaken's People

Contributors

newmarcel avatar

Watchers

 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.