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.7.2.tar.gz
(4.2 kB
view hashes)