I am attempting to use launchd to have SelfControl be active from 8am to 8pm. My first attempt was to just use launchd and have a little bash script which starts self control (for 12 hours) at 8am, but this isn't really flexible enough because if my laptop is off at 8am then obviously nothing happens.
Any advice on a better way to approach this problem or modify my current approach?
Here is the .plist
<?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>my.selfControlScheduler</string> <key>Program</key> <string>/Users/ira/Documents/coding/self_control/sc_sched.sh</string> <key>StartCalendarInterval</key> <dict> <key>Hour</key> <integer>8</integer> <key>Minute</key> <integer>0</integer> </dict> </dict> </plist>
And here is the bash script
sudo /Applications/SelfControl.app/Contents/MacOS/org.eyebeam.SelfControl $(id -u $(whoami)) --install
The length of time to block the blacklist in SelfControl for can be set by doing
defaults write org.eyebeam.SelfControl "BlockDuration"=xxx
I think that's all the relevant information