sindresorhus/get-windows

Trigger an event when focus changes

開放

#1 建立於 2016年4月4日

 (5 則留言) (14 個反應) (0 位負責人)JavaScript (194 個分叉)user submission
enhancementhelp wanted

倉庫指標

星標
 (913 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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 😀

貢獻者指南