hs.application.watcher
Watch for application launch/terminate events
This module is based primarily on code from the previous incarnation of Mjolnir by Markus Engelbrecht and Steven Degutis.
API Overview
- Constants - Useful values which cannot be changed
- Constructors - API calls which return an object, typically one that offers API methods
- Methods - API calls which can only be made on an object returned by a constructor
API Documentation
Constants
activated
| Signature | hs.application.watcher.activated |
|---|---|
| Type | Constant |
| Description |
An application has been activated (i.e. given keyboard/mouse focus) |
| Source | extensions/application/libapplication_watcher.m line 33 |
deactivated
| Signature | hs.application.watcher.deactivated |
|---|---|
| Type | Constant |
| Description |
An application has been deactivated (i.e. lost keyboard/mouse focus) |
| Source | extensions/application/libapplication_watcher.m line 37 |
launched
| Signature | hs.application.watcher.launched |
|---|---|
| Type | Constant |
| Description |
An application has been launched |
| Source | extensions/application/libapplication_watcher.m line 17 |
launching
| Signature | hs.application.watcher.launching |
|---|---|
| Type | Constant |
| Description |
An application is in the process of being launched |
| Source | extensions/application/libapplication_watcher.m line 13 |
terminated
| Signature | hs.application.watcher.terminated |
|---|---|
| Type | Constant |
| Description |
An application has been terminated |
| Source | extensions/application/libapplication_watcher.m line 21 |
Constructors
new
| Signature | hs.application.watcher.new(fn) -> watcher |
|---|---|
| Type | Constructor |
| Description |
Creates an application event watcher |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/application/libapplication_watcher.m line 142 |
Methods
start
| Signature | hs.application.watcher:start() |
|---|---|
| Type | Method |
| Description |
Starts the application watcher |
| Parameters |
|
| Returns |
|
| Source | extensions/application/libapplication_watcher.m line 224 |
stop
| Signature | hs.application.watcher:stop() |
|---|---|
| Type | Method |
| Description |
Stops the application watcher |
| Parameters |
|
| Returns |
|
| Source | extensions/application/libapplication_watcher.m line 247 |
© 2014–2017 Hammerspoon contributors
Licensed under the MIT License.
https://www.hammerspoon.org/docs/hs.application.watcher.html