I'm trying to figure out how to create a daemon that will take screenshots every 5 minutes on OSX.
The daemon with launchctl seems to run under a separate session so the screenshots I'm getting right now are just of my blank home screen rather than my actual current session screen.
Currently I have a screencapture script:
#!/bin/bash
screencapture ~/Desktop/$(date +%y%m%d%H%M%S).png
And a plist file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.startup</string>
<key>Program</key>
<string>path_to_script/screenshots.sh</string>
<key>StartInterval</key>
<integer>15</integer>
</dict>
</plist>