https://github.com/bbqsrc/raunch
A safe wrapper around launchd launch_activate_socket
https://github.com/bbqsrc/raunch
Last synced: 11 months ago
JSON representation
A safe wrapper around launchd launch_activate_socket
- Host: GitHub
- URL: https://github.com/bbqsrc/raunch
- Owner: bbqsrc
- Created: 2020-05-07T21:26:26.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-15T12:11:47.000Z (almost 2 years ago)
- Last Synced: 2024-05-01T22:29:54.086Z (almost 2 years ago)
- Language: Rust
- Homepage: https://crates.io/crates/raunch
- Size: 8.79 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Raunch
A safe wrapper around launchd `launch_activate_socket`.
```rust,no_run
#[cfg(target_os = "macos")]
let descriptors = raunch::activate_socket("socket-name").expect("activation to work");
```
The name of the socket (here `socket-name`) needs to match the socket name in the `plist` file:
```xml
Label
com.example.agent
OnDemand
ProgramArguments
example-agent
RunAtLoad
Sockets
socket-name
SockPathName
/Users/test/.openpgp-card-ssh-agent
SockFamily
Unix
```
The file can be placed in `~/Library/LaunchAgents` and loaded via `launchctl load ~/Library/LaunchAgents/com.example.agent.plist`.