LaunchAgents + python
Project description
Installation
$ [sudo] pip install mac-agents
Examples
~/Library/LaunchAgents/file.py
import mac_agents
class Agent(mac_agents.Agent):
StartInterval = 5 # capital letter
def run(self):
pass
if __name__ == "__main__":
Agent().run()
$ find ~/Library/LaunchAgents -name "*.py" | xargs python -m mac_agents.create "$@"
$ find ~/Library/LaunchAgents -name "*.plist" | xargs launchctl load # or launchctl unload
$ launchctl list | grep .py$ | awk '{print $3}' | xargs -I '{}' launchctl remove {}
$ find ~/Library/LaunchAgents -name "*.py.plist" -exec rm {} +
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mac-agents-2020.12.3.tar.gz
(4.1 kB
view details)
File details
Details for the file mac-agents-2020.12.3.tar.gz
.
File metadata
- Download URL: mac-agents-2020.12.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80ceb8f5b58fe1c852845ac4b40c85aaf0cb7dd3418db9c610e03dd7fa2b82ee |
|
MD5 | a31d831825a34b95f95e2ea8ea73e39e |
|
BLAKE2b-256 | dfcef45ba24464e771f1dc848bd5aaf810b5c13bce948a1cac8fb6b56842cd0e |