rethocker 0.2.0 → 0.2.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/README.md +2 -47
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -253,6 +253,8 @@ actions.window.thirdCenter()
|
|
|
253
253
|
actions.window.thirdRight()
|
|
254
254
|
actions.window.quarterTopLeft()
|
|
255
255
|
actions.window.maximize()
|
|
256
|
+
|
|
257
|
+
// NOTE: you can use this to compose any custom layouts
|
|
256
258
|
actions.window.halfLeft("Figma") // move specific app
|
|
257
259
|
|
|
258
260
|
// App management
|
|
@@ -272,8 +274,6 @@ actions.media.volumeDown(10)
|
|
|
272
274
|
// System
|
|
273
275
|
actions.system.sleep()
|
|
274
276
|
actions.system.lockScreen()
|
|
275
|
-
actions.system.missionControl()
|
|
276
|
-
actions.system.emptyTrash()
|
|
277
277
|
|
|
278
278
|
// Run a Shortcut from the macOS Shortcuts app
|
|
279
279
|
actions.shortcut("My Shortcut Name")
|
|
@@ -365,48 +365,3 @@ await rk.stop()
|
|
|
365
365
|
// (by default rethocker keeps the event loop alive)
|
|
366
366
|
rk.unref()
|
|
367
367
|
```
|
|
368
|
-
|
|
369
|
-
## API reference
|
|
370
|
-
|
|
371
|
-
### `rethocker(rules?, options?)` → `RethockerHandle`
|
|
372
|
-
|
|
373
|
-
| Option | Type | Description |
|
|
374
|
-
|---|---|---|
|
|
375
|
-
| `binaryPath` | `string?` | Override the native binary path |
|
|
376
|
-
|
|
377
|
-
### `RethockerHandle`
|
|
378
|
-
|
|
379
|
-
| Method | Returns | Description |
|
|
380
|
-
|---|---|---|
|
|
381
|
-
| `add(rule \| rule[])` | `void` | Add one or more rules |
|
|
382
|
-
| `remove(id)` | `void` | Remove a rule permanently |
|
|
383
|
-
| `enable(id?)` | `void` | Enable a rule by ID, or all rules if no ID |
|
|
384
|
-
| `disable(id?)` | `void` | Disable a rule by ID, or all rules if no ID |
|
|
385
|
-
| `on(event, listener)` | `() => void` | Subscribe to an event; returns an unsubscribe function |
|
|
386
|
-
| `execute(command)` | `Promise<void>` | Run a shell command immediately (accepts `string \| string[]`) |
|
|
387
|
-
| `start()` | `Promise<void>` | Await daemon readiness (optional) |
|
|
388
|
-
| `stop()` | `Promise<void>` | Stop the daemon |
|
|
389
|
-
| `unref()` | `void` | Allow the process to exit while the daemon runs |
|
|
390
|
-
| `ready` | `boolean` | Whether the daemon is ready |
|
|
391
|
-
|
|
392
|
-
### Events
|
|
393
|
-
|
|
394
|
-
| Event | Arguments | Description |
|
|
395
|
-
|---|---|---|
|
|
396
|
-
| `"ready"` | — | Daemon ready |
|
|
397
|
-
| `"key"` | `KeyEvent` | Every key event (stream auto-activates on subscribe) |
|
|
398
|
-
| `"accessibilityDenied"` | — | Accessibility permission not granted |
|
|
399
|
-
| `"error"` | `code, message` | Native daemon error |
|
|
400
|
-
| `"exit"` | `code` | Native process exited unexpectedly |
|
|
401
|
-
|
|
402
|
-
### `KeyEvent`
|
|
403
|
-
|
|
404
|
-
| Field | Type | Description |
|
|
405
|
-
|---|---|---|
|
|
406
|
-
| `type` | `"keydown" \| "keyup" \| "flags"` | Event type |
|
|
407
|
-
| `keyCode` | `number` | macOS virtual key code |
|
|
408
|
-
| `modifiers` | `Modifier[]` | Active modifiers |
|
|
409
|
-
| `app` | `string?` | Frontmost app display name |
|
|
410
|
-
| `appBundleID` | `string?` | Frontmost app bundle ID |
|
|
411
|
-
| `suppressed` | `boolean` | Whether the key was consumed |
|
|
412
|
-
| `ruleID` | `string?` | ID of the matched rule |
|