2019.4.18 • Published 5 years ago

launchd-generator v2019.4.18

Weekly downloads
3
License
Unlicense
Repository
-
Last release
5 years ago

npm.io

launchd.plist generator

Installation

$ [sudo] pip install launchd-generator

Features

How it works

script.py -> script.py.plist, script.sh -> script.sh.plist

#!/usr/bin/env <interpreter>

KEY: VALUE
CUSTOM_KEY@type: VALUE # custom key. @type required - array/bool/integer/string

Scripts usage

usage: launchd-generator script ...

Examples

agent.sh

#!/usr/bin/env bash
# StartInterval: 10

agent.sh.plist

<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

#!/usr/bin/env python
"""
WatchPaths: ~/Desktop
WatchPaths: ~/Downloads
"""

agent.py.plist

<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>
$ cd ~/Library/LaunchAgents && find . \( -name "*.sh" -o -name "*.py" \) | xargs launchd-generator

Related projects

Links

2019.4.18

5 years ago

2019.3.22

5 years ago

2019.3.1

5 years ago

2019.2.28

5 years ago

2019.2.27

5 years ago