Skip to content

Instantly share code, notes, and snippets.

@matthewspear
Last active July 29, 2016 12:57
Show Gist options
  • Save matthewspear/fa5224f759fca735db7a to your computer and use it in GitHub Desktop.
Save matthewspear/fa5224f759fca735db7a to your computer and use it in GitHub Desktop.
SelfControl Terminal Shortcuts
# Add these lines to ~/.bash_profile or ~/.zshrc:
# SelfControl
alias sc-read="defaults read org.eyebeam.SelfControl"
alias sc-run="sudo /Applications/SelfControl.app/Contents/MacOS/org.eyebeam.SelfControl $(id -u $(whoami)) --install"
alias sc-check="sudo /Library/PrivilegedHelperTools/org.eyebeam.SelfControl $(id -u $(whoami)) --checkup"
sc-set()
{
if [ "$1" = "" ]; then
echo "Please provide a valid input"
else
defaults write org.eyebeam.SelfControl "BlockDuration" $1
fi
}
autoload sc-set
@matthewspear
Copy link
Author

Some simple aliases I use for running SelfControl via the terminal:

sc-read - prints current settings
sc-run - used to set a block running
sc-check - used for checking a block once it is finished
sc-set 10 - sets the block length in minutes, this example is of 10 minutes

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