Created
January 9, 2019 11:08
-
-
Save ykrkn/0923e0f9af32e1d5258d6cad8d21d578 to your computer and use it in GitHub Desktop.
mac os x launch agent for screen capture
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.ykrkn.screencapture</string> | |
<key>UserName</key> | |
<string>sx</string> | |
<key>WorkingDirectory</key> | |
<string>/Users/yurykrikun/Documents/screencapture</string> | |
<key>Program</key> | |
<string>/Users/yurykrikun/Documents/screencapture/doit</string> | |
<key>StartInterval</key> | |
<integer>60</integer> | |
</dict> | |
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
DATE=$(date +%Y%m%d) | |
CDIR=$(pwd) | |
TIME=$(date +%H%M%S) | |
FILE="$CDIR/$DATE/$DATE$TIME.png" | |
if [ ! -d "$CDIR/$DATE" ]; then | |
mkdir "$CDIR/$DATE" | |
fi | |
echo "$FILE" | |
screencapture "$FILE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Users/yurykrikun/Documents/screencapture/doit | |
cd ~/Library/LaunchAgents | |
launchctl load com.ykrkn.screencapture.plist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment