An open API service indexing awesome lists of open source software.

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

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`.