跳转到主要内容

launchd.plist生成器

项目描述

安装

$ [sudo] pip install launchd-generator
$ [sudo] npm i -g launchd-generator

工作原理

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

功能

示例

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

相关

链接

readme42.com

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪一个,请了解更多关于安装包的信息。

源代码分发

launchd-generator-2020.12.3.tar.gz (3.2 kB 查看哈希值)

上传时间 源代码

由以下机构支持

AWSAWS云计算和安全赞助商DatadogDatadog监控FastlyFastlyCDNGoogleGoogle下载分析MicrosoftMicrosoftPSF赞助商PingdomPingdom监控SentrySentry错误记录StatusPageStatusPage状态页面