Skip to content

Instantly share code, notes, and snippets.

@matthewspear
Last active July 29, 2016 12:57
Show Gist options
  • Select an option

  • Save matthewspear/fa5224f759fca735db7a to your computer and use it in GitHub Desktop.

Select an option

Save matthewspear/fa5224f759fca735db7a to your computer and use it in GitHub Desktop.

Revisions

  1. matthewspear renamed this gist Feb 28, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. matthewspear created this gist Feb 28, 2016.
    17 changes: 17 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    # 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