Skip to content

Instantly share code, notes, and snippets.

@ssaadh
Created April 20, 2020 03:35
Show Gist options
  • Save ssaadh/e8aa80601f0269312e43bd24cf89b3e8 to your computer and use it in GitHub Desktop.
Save ssaadh/e8aa80601f0269312e43bd24cf89b3e8 to your computer and use it in GitHub Desktop.
I'm doing this on Mac using launchctl. Can include the actual plist as well. Really basic though. Runs every 10 seconds. I turn it off when not running OBS. (launchctl unload screencapture-obs-agent.plist)
<?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>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/local/sbin</string>
</dict>
<key>Label</key>
<string>screencapture-obs-agent</string>
<key>ProgramArguments</key>
<array>
<string>/Users/makeanothertelephonecall/Dropbox/~Local/bin/screencapture-obs-agent.sh</string>
</array>
<key>RunAtLoad</key>
<false/>
<key>StartInterval</key>
<integer>2</integer>
</dict>
</plist>
# Thanks to @Nick Wong @nickwongv for this idea!
# -S doesn't seem necessary. Doing whÎole desktop, not a selection
# -m will get main monitor. Not active though, right?
screencapture -Cx /Volumes/mmSKLegionFSpace/NAS/_sharing/accountability/default_capture_1.png
# If want to run another one again with a delay vs only having macOS launch agent control time
# a 2nd 3 sec delay
# screencapture -T 3 -Cx /Volumes/mmSKLegionFSpace/NAS/_sharing/accountability/default_capture_1.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment