tony48787 / active-window

Get active window title in Node.js.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

active-window

Get active window title in Node.js.

Compatible with Linux, Windows 7+, and OSX;

Usage

var monitor = require('active-window');

callback = function(window){
  try {
    console.log("App: " + window.app);
    console.log("Title: " + window.title);
  }catch(err) {
      console.log(err);
  } 
}
/*Watch the active window 
  @callback
  @number of requests; infinity = -1 
  @interval between requests
*/
//monitor.getActiveWindow(callback,-1,1);

//Get the current active window
monitor.getActiveWindow(callback);

Tested on

  • Windows
  • Windows 10
  • Windows 7
  • Linux
    • Raspbian [lxdm]
    • Debian 8 [cinnamon]
  • OSX
    • Yosemite 10.10.1

TODO

  • Test on more operating systems.
  • Use native APIs.

License

MIT

About

Get active window title in Node.js.


Languages

Language:JavaScript 67.4%Language:PowerShell 14.4%Language:AppleScript 9.5%Language:Shell 8.7%