Metadata-Version: 2.1
Name: launchd-generator
Version: 2019.2.27
Summary: launchd.plist generator
Home-page: https://github.com/looking-for-a-job/launchd-generator
License: UNKNOWN
Keywords: launchd generator
Platform: UNKNOWN
Classifier: License :: Public Domain
Classifier: Operating System :: Unix
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Description-Content-Type: text/markdown
Requires-Dist: setuptools

[![](https://img.shields.io/badge/OS-Unix-blue.svg?longCache=True)]()

#### Install
```bash
$ [sudo] pip install launchd-generator
```

#### Features
+   generate launchd.plist from ANY script
+   define [launchd.plist keys](http://www.manpagez.com/man/5/launchd.plist/) in script comments

#### How it works
`script.py` -> `script.py.plist`, `script.sh` -> `script.sh.plist`

```
#!/usr/bin/env <interpreter>

KEY: VALUE
```

#### CLI
```bash
usage: launchd-generator script ...
```

#### Examples
`agent.sh`
```bash
#!/usr/bin/env bash
# StartInterval: 10
```

`agent.sh.plist`
```xml
<key>ProgramArguments</key>
<array>
    <string>/path/to/agent.sh</string>
    <string>/path/to/agent.sh.plist</string>
</array>
<key>StartInterval</key>
<integer>10</integer>
```

`agent.py`
```python
#!/usr/bin/env python
"""
WatchPaths: ~/Desktop
WatchPaths: ~/Downloads
"""
```

`agent.py.plist`
```xml
<key>ProgramArguments</key>
<array>
    <string>/path/to/agent.py</string>
    <string>/path/to/agent.py.plist</string>
</array>
<key>WatchPaths</key>
<array>
    <string>/Users/username/Desktop</string>
    <string>/Users/username/Downloads</string>
</array>
```

```bash
$ cd ~/Library/LaunchAgents && find . \( -name "*.sh" -o -name "*.py" \) | xargs launchd-generator
```

#### Links
+   [launchd.plist(5)](http://www.manpagez.com/man/5/launchd.plist/)

<p align="center"><a href="https://pypi.org/project/readme-md/">readme-md</a> - README.md generator</p>

