waketimer

1.0.4 • Public • Published

waketimer

Figure out how long your screen has been locked/unlocked.

Rationale

I often work long hours, and I'd like to set reminders based on how long the

Usage

Server

# install globally
npm install -g waketimer
# run
waketimer
# => 'waketimer server running'

Client

const getWaketimerState = require('waketimer/client')

async function run () {
    const currentState = await getWaketimerState()
    console.log(currentState)
    // => { state: 'unlocked', time: 57673 }
}

Requirements

Uses async/await so requires Node 8+

You'll also need the Quartz python library installed

pip install pyobjc-framework-Quartz

Prior art

The ability to get data from CGSessionCopyCurrentDictionary is basically a direct crib of agentcooper's node-osx-quartz

Readme

Keywords

none

Package Sidebar

Install

npm i waketimer

Weekly Downloads

8

Version

1.0.4

License

ISC

Unpacked Size

11.4 kB

Total Files

11

Last publish

Collaborators

  • colophonemes