Skip to content

Instantly share code, notes, and snippets.

@maurelian
Created January 16, 2018 14:25
Show Gist options
  • Save maurelian/ca531751b6d7c4111dd6da9bb3ee853f to your computer and use it in GitHub Desktop.
Save maurelian/ca531751b6d7c4111dd6da9bb3ee853f to your computer and use it in GitHub Desktop.
function controlSelf() {
eval "defaults write org.eyebeam.SelfControl BlockDuration -int $1"
extras=""
if [ "$2" = "nuke" ]; then
extras="inbox.google.com slack.com"
fi
blacklist="facebook.com news.ycombinator.com reddit.com twitter.com $extras"
eval "defaults write org.eyebeam.SelfControl HostBlacklist -array $blacklist"
defaults read org.eyebeam.SelfControl
sudo /Applications/SelfControl.app/Contents/MacOS/org.eyebeam.SelfControl $(id -u $(whoami)) --install > /dev/null 2>&1
}
@maurelian
Copy link
Author

usage:

controlSelf 60 block your basic blacklist for 60 minutes
controlSelf 60 nuke block the basic blacklist + extras for 60 minutes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment