Git Product home page Git Product logo

node-desktop-idle's Introduction

desktop idle

Build status Build Status Monthly Downloads

Node/Electron module to detect idle desktop users (macOS, Windows, Linux, FreeBSD and OpenBSD).

Stable | Actively maintained | Pull Requests Welcome

Forked and inspired from node-system-idle-time

Installation

npm install --save desktop-idle
# or yarn
yarn add desktop-idle

Cross-Platform Support

Usage

var desktopIdle = require('desktop-idle');
console.log(desktopIdle.getIdleTime());

Linux Requirements

X server development package and pkg-config are required:

apt install libxss-dev pkg-config

Test

yarn test

License

MIT - Bithavoc<[email protected]>

node-desktop-idle's People

Contributors

bithavoc avatar nealie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

node-desktop-idle's Issues

Add info about rebuild to README

Hello!

Can you please add the info that in some cases one need to rebuild the native module for electron to match the node version provided with electron?

node-gyp rebuild --target=1.7.10 --arch=x64 --dist-url=https://atom.io/download/atom-shell

Also referencing this doc will be helpful.

Support for arm architectures

Are there any specific reasons as to why only x86 architectures are listed as supported?

Would it be possible to add support for arm-based architectures in the future?

Cheers,
Ghis

Maximum number of clients reached

Hello bithavoc, thanks for the nice pkg, was exactly what I was looking for.
But trying to run this on linux for some days now:

var desktopIdle = require('desktop-idle')
setInterval(function() {
  console.log(desktopIdle.getIdleTime())
}, 1000)

Keeps (after some seconds, failing into this):

┏ Electron -------------------

  1
  
┗ ----------------------------

┏ Electron -------------------

  Maximum number of clients reached

┗ ----------------------------
....

Keeps repeating "1", fills ram and crash PC... HAVOC ! ! heh.
Tried running it from node and from window, same behavior.

Any help much appreciated, thank you!

Run tests on FreeBSD

This module uses AppVeyor for Windows, Travis for Linux and Mac. We need to add FreeBSD support to the test suite, so I'm looking for contributors to add CI support for FreeBSD.

Cirrus CI supports FreeBSD.

/cc @nealie

desktop-idle with npm on windows

When trying to install desktop-idle on Windows with npm I get the following error:

Unsupported platform for [email protected]: wanted {"os":"windows,linux,darwin","arch":"x64"} (current: {"os":"win32","arch":"x64"})

Fail including this module in electron

Hi - I tried using your lib in an electron build / angular application but I fail ...

"electron": "^3.0.2",
"electron-builder": "^20.28.4",
"electron-reload": "^1.2.5",

following error pops up:
image

Electron: (process.versions)
{ http_parser: '2.8.0',
node: '10.2.0',
v8: '6.6.346.32',
uv: '1.20.3',
zlib: '1.2.11',
ares: '1.14.0',
modules: '64',
nghttp2: '1.29.0',
napi: '3',
openssl: '1.1.0h',
electron: '3.0.2',
chrome: '66.0.3359.181' }

c:_Entwicklung\Mattermost\matter-mon>node -v
v10.11.0

c:_Entwicklung\Mattermost\matter-mon>npm -v
6.4.1

I already rebuild it with node 10 "npm i desktop-idle" but always get this error ...

Expected in: flat namespace

Hi, This module install successfully but when i use it and run with npm start application throw below error message in terminal. Please help to resolve this issue. I need this module to use in my electron application. I am using it in OSX.

dyld: lazy symbol binding failed: Symbol not found: __ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeE
Referenced from: /Users/balakrishna/electron-quick-start/node_modules/desktop-idle/build/Release/desktopIdle.node
Expected in: flat namespace

dyld: Symbol not found: __ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeE
Referenced from: /Users/balakrishna/electron-quick-start/node_modules/desktop-idle/build/Release/desktopIdle.node
Expected in: flat namespace

Packaging for Windows from Mac

Hey there,

Great work on the package. I used your native module on my Electron App and it works perfectly well during development, but as soon as i try to package your Native Module from a non target OS,
i.e Packaging for Windows from a Mac machine. The resulting executable fails to run on Windows and shows the following error, the error varies according to the ASAR setting.

screen shot 2017-12-09 at 1 13 29 am

This is a well known issue amongst people who try to package for all platforms from a single platform. There are many hacks and solutions to make this work however, the most promising one
is perhaps https://www.npmjs.com/package/prebuild which lets you generate prebuilt binaries
for the different platforms. Will help a lot of folks like me.

Is this something you'll be looking into at some point or are you already working on it?

Thanks again.

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.