@miniben90/x-win 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -2
- package/README.md +24 -12
- package/package.json +9 -9
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
3
|
+
Copyright (c) 2023 BENKHADRA Hocine
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,13 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
# @miniben90/x-win
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
> It work with Microsoft Windows (10, 11), Linux (With Xserver) and Macos(*).
|
|
7
|
+
This project uses Rust and napi-rs to make it easy to obtain the active window or an array of open windows. It works on Microsoft Windows (10, 11), [Linux (with X server)](#linux), and [macOS](#darwin).
|
|
9
8
|
|
|
10
9
|
## How to install
|
|
11
10
|
|
|
12
|
-
Easy to install:
|
|
13
|
-
|
|
14
11
|
```sh
|
|
15
12
|
# With npm
|
|
16
13
|
npm i @miniben90/x-win
|
|
@@ -21,9 +18,10 @@ yarn add @miniben90/x-win
|
|
|
21
18
|
|
|
22
19
|
## How to use
|
|
23
20
|
|
|
24
|
-
### Get information
|
|
21
|
+
### Get information about the currently active window
|
|
25
22
|
|
|
26
23
|
`exemple.ts`:
|
|
24
|
+
|
|
27
25
|
```typescript
|
|
28
26
|
import { activeWindow, type WindowInfo } from '@miniben90/x-win';
|
|
29
27
|
|
|
@@ -33,7 +31,8 @@ console.log(currentWindow);
|
|
|
33
31
|
```
|
|
34
32
|
|
|
35
33
|
`response`:
|
|
36
|
-
|
|
34
|
+
|
|
35
|
+
```javascript
|
|
37
36
|
{
|
|
38
37
|
id: 26148,
|
|
39
38
|
info: {
|
|
@@ -56,9 +55,10 @@ console.log(currentWindow);
|
|
|
56
55
|
}
|
|
57
56
|
```
|
|
58
57
|
|
|
59
|
-
### Get
|
|
58
|
+
### Get a list of open windows with information
|
|
60
59
|
|
|
61
60
|
`exemple.ts`:
|
|
61
|
+
|
|
62
62
|
```typescript
|
|
63
63
|
import { openWindows, type WindowInfo } from '@miniben90/x-win';
|
|
64
64
|
|
|
@@ -68,7 +68,8 @@ console.log(windows);
|
|
|
68
68
|
```
|
|
69
69
|
|
|
70
70
|
`response`:
|
|
71
|
-
|
|
71
|
+
|
|
72
|
+
```javascript
|
|
72
73
|
[{
|
|
73
74
|
id: 26148,
|
|
74
75
|
info: {
|
|
@@ -91,15 +92,26 @@ console.log(windows);
|
|
|
91
92
|
}]
|
|
92
93
|
```
|
|
93
94
|
|
|
95
|
+
# Linux
|
|
96
|
+
|
|
97
|
+
> Dependencies are required to be installed for development purposes.
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
sudo apt install libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxcb-shm0-dev
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
# Darwin
|
|
94
104
|
|
|
95
|
-
##
|
|
105
|
+
## Screen recording permission introduced in macOS 10.15 Catalina
|
|
96
106
|
|
|
97
|
-
>
|
|
98
|
-
> Macos require to grant access for recording screen. If your project don't have it the title will have `<unknown>` as value.
|
|
107
|
+
> macOS requires you to grant access for screen recording. If your project does not have it, the title will display `<unknown>` as its value.
|
|
99
108
|
|
|
100
109
|
<hr class="padding-top: 30px;padding-bottom:30px">
|
|
101
110
|
|
|
102
|
-
|
|
111
|
+
# Project References
|
|
112
|
+
|
|
113
|
+
**Project Inspirations:**
|
|
114
|
+
|
|
103
115
|
* [active-win](https://github.com/sindresorhus/active-win)
|
|
104
116
|
* [active-win-pos-rs](https://github.com/dimusic/active-win-pos-rs)
|
|
105
117
|
* This project was generated with [@napi-rs/cli](https://github.com/napi-rs)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miniben90/x-win",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "0.4.
|
|
3
|
+
"description": "This package allows you to retrieve precise information about active and open windows on Windows, MacOS, and Linux. You can obtain the position, size, title, and other memory of windows.",
|
|
4
|
+
"version": "0.4.1",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -61,12 +61,12 @@
|
|
|
61
61
|
},
|
|
62
62
|
"packageManager": "yarn@3.5.0",
|
|
63
63
|
"optionalDependencies": {
|
|
64
|
-
"@miniben90/x-win-win32-x64-msvc": "0.4.
|
|
65
|
-
"@miniben90/x-win-darwin-x64": "0.4.
|
|
66
|
-
"@miniben90/x-win-linux-x64-gnu": "0.4.
|
|
67
|
-
"@miniben90/x-win-darwin-arm64": "0.4.
|
|
68
|
-
"@miniben90/x-win-win32-arm64-msvc": "0.4.
|
|
69
|
-
"@miniben90/x-win-win32-ia32-msvc": "0.4.
|
|
70
|
-
"@miniben90/x-win-darwin-universal": "0.4.
|
|
64
|
+
"@miniben90/x-win-win32-x64-msvc": "0.4.1",
|
|
65
|
+
"@miniben90/x-win-darwin-x64": "0.4.1",
|
|
66
|
+
"@miniben90/x-win-linux-x64-gnu": "0.4.1",
|
|
67
|
+
"@miniben90/x-win-darwin-arm64": "0.4.1",
|
|
68
|
+
"@miniben90/x-win-win32-arm64-msvc": "0.4.1",
|
|
69
|
+
"@miniben90/x-win-win32-ia32-msvc": "0.4.1",
|
|
70
|
+
"@miniben90/x-win-darwin-universal": "0.4.1"
|
|
71
71
|
}
|
|
72
72
|
}
|