sindresorhus/get-windows

Trigger an event when focus changes

Ouverte

#1 ouverte le 4 avr. 2016

 (5 commentaires) (14 réactions) (0 personne assignée)JavaScript (194 forks)user submission
enhancementhelp wanted

Métriques du dépôt

Stars
 (913 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

I imagine it would be something like:

const activeWin  = require('active-win');

activeWin.on('change', win => {
    console.log(win.title);
});

With win being the same as activeWin() returns.

No idea how to achieve this though as it would have to communicate with the binary somehow. Maybe spawn the native binary when someone subscribes to the events, and have the binary push to stdout for each event.

PR welcome 😀

Guide contributeur