Uh oh!
There was an error while loading. Please reload this page.
forked from sentialx/node-window-manager
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.js
More file actions
Latest commit
32 lines (24 loc) · 778 Bytes
/
Copy pathexample.js
File metadata and controls
32 lines (24 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const{ windowManager }=require("./dist/index");
console.log(windowManager.requestAccessibility());// required on macOS
constwindow=windowManager.getActiveWindow();
console.log(window.getTitle());
constbounds=window.getBounds();
console.log(bounds);
window.setBounds({x: 0,y: 0});
window.maximize();
setTimeout(()=>{
window.setBounds(bounds);
},1000);
console.log("Windows list");
windowManager.getWindows().forEach((window)=>{
if(window.isVisible()){
console.log(window.getTitle(),window.path);
}
});
windowManager.on("window-activated",(window)=>{
console.log(window.path);
});
console.log("Monitors list");
windowManager.getMonitors().forEach((monitor)=>{
console.log(monitor.getWorkArea());
});