Skip to content

Commit

Permalink
Rename package from active-win to get-windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 30, 2024
1 parent 94b6bf1 commit 69cba70
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 25 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ yarn.lock
/main
/build
lib/binding
/build-tmp-napi-v3
/build-tmp-napi-v6
/build-tmp-napi-v9
8 changes: 4 additions & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
import PackageDescription

let package = Package(
name: "ActiveWin",
name: "GetWindows",
products: [
.executable(
name: "active-win",
name: "get-windows",
targets: [
"ActiveWinCLI"
"GetWindowsCLI"
]
)
],
targets: [
.executableTarget(
name: "ActiveWinCLI"
name: "GetWindowsCLI"
)
]
)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ let enableOpenWindowsList = CommandLine.arguments.contains("--open-windows-list"
// Show accessibility permission prompt if needed. Required to get the URL of the active tab in browsers.
if !disableAccessibilityPermission {
if !AXIsProcessTrustedWithOptions(["AXTrustedCheckOptionPrompt": true] as CFDictionary) {
print("active-win requires the accessibility permission in “System Settings › Privacy & Security › Accessibility”.")
print("get-windows requires the accessibility permission in “System Settings › Privacy & Security › Accessibility”.")
exit(1)
}
}
Expand All @@ -101,7 +101,7 @@ if
!disableScreenRecordingPermission,
!hasScreenRecordingPermission()
{
print("active-win requires the screen recording permission in “System Settings › Privacy & Security › Screen Recording”.")
print("get-windows requires the screen recording permission in “System Settings › Privacy & Security › Screen Recording”.")
exit(1)
}

Expand Down
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Get metadata about the [active window](https://en.wikipedia.org/wiki/Active_wind
@example
```
import {activeWindow} from 'active-win';
import {activeWindow} from 'get-windows';
const result = await activeWindow();
Expand All @@ -129,7 +129,7 @@ Get metadata about the [active window](https://en.wikipedia.org/wiki/Active_wind
@example
```
import {activeWindowSync} from 'active-win';
import {activeWindowSync} from 'get-windows';
const result = activeWindowSync();
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "active-win",
"name": "get-windows",
"version": "9.0.0",
"description": "Get metadata about the active window and open windows (title, id, bounds, owner, URL, etc)",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/active-win.git"
"url": "git+https://github.com/sindresorhus/get-windows.git"
},
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
Expand All @@ -24,9 +24,9 @@
"node": ">=18.18"
},
"binary": {
"module_name": "node-active-win",
"module_name": "node-get-windows",
"module_path": "./lib/binding/napi-{napi_build_version}-{platform}-{libc}-{arch}",
"host": "https://github.com/sindresorhus/active-win/releases/download/",
"host": "https://github.com/sindresorhus/get-windows/releases/download/",
"remote_path": "v{version}",
"package_name": "napi-{napi_build_version}-{platform}-{libc}-{arch}.tar.gz",
"napi_versions": [
Expand All @@ -39,7 +39,7 @@
"build:windows:install": "node-pre-gyp install --fallback-to-build",
"build:windows": "node-pre-gyp build",
"build:windows:debug": "node-pre-gyp build --debug",
"build:macos": "swift build --configuration=release --arch arm64 --arch x86_64 && mv .build/apple/Products/Release/active-win main",
"build:macos": "swift build --configuration=release --arch arm64 --arch x86_64 && mv .build/apple/Products/Release/get-windows main",
"install": "node-pre-gyp install --fallback-to-build"
},
"files": [
Expand Down
15 changes: 5 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# active-win
# get-windows

> Get metadata about the [active window](https://en.wikipedia.org/wiki/Active_window) and open windows (title, id, bounds, owner, URL, etc)
Expand All @@ -7,15 +7,15 @@ Works on macOS 10.14+, Linux ([note](#linux-support)), and Windows 7+.
## Install

```sh
npm install active-win
npm install get-windows
```

**[This is an ESM package which requires you to use ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c)**

## Usage

```js
import {activeWindow} from 'active-win';
import {activeWindow} from 'get-windows';

console.log(await activeWindow(options));
/*
Expand Down Expand Up @@ -117,7 +117,7 @@ Wayland is not supported. For security reasons, Wayland does not provide a way t

## Electron usage

If you use this package in an Electron app that is sandboxed and you want to get the `.url` property, you need to add the [proper entitlements and usage description](https://github.com/sindresorhus/active-win/issues/99#issuecomment-870874546).
If you use this package in an Electron app that is sandboxed and you want to get the `.url` property, you need to add the [proper entitlements and usage description](https://github.com/sindresorhus/get-windows/issues/99#issuecomment-870874546).

## Users

Expand All @@ -126,12 +126,7 @@ If you use this package in an Electron app that is sandboxed and you want to get

## Related

- [active-win-cli](https://github.com/sindresorhus/active-win-cli) - CLI for this module

## Maintainers

- [Sindre Sorhus](https://github.com/sindresorhus)
- [Sebastián Ramírez](https://github.com/tiangolo)
- [windows-cli](https://github.com/sindresorhus/windows-cli) - CLI for this package

## Development

Expand Down

0 comments on commit 69cba70

Please sign in to comment.