Coder Social home page Coder Social logo

headspace.spoon's Introduction

Headspace

Protect your focus and keep your head in the right space by blocking distracting applications from even opening.

Controls

Headspace listens for URL schemes of the following format:

  • hammerspoon://setBlacklist?tags=comma,separated,tags&apps=comma,separated,names&kill=<true or false>
  • hammerspoon://setWhitelist?tags=comma,separated,tags&apps=comma,separated,names&kill=<true or false>
  • hammerspoon://stopHeadspace

setBlacklist and setWhitelist are exclusive. Setting a new list will wipe out the previous settings.

If you pass kill=true in the URL, Headspace will apply your new rules to any running applications in your OSX Dock, immediately killing matching applications.

If an app is either tagged in the MacOS filesystem with a matching tag or it's name is in the apps list it will be matched and the rules applied.

MacOS doesn't let you tag built-in applications (Messages.app, Mail.app, etc.) so you can use the apps list to block them.

Optionally, if you filesystem tag an application whitelisted no rules will ever be applied to it. This is useful for things like launchers or other tools you always want available.

Usage

Using the URL scheme means that you can use any tool as your main interface for Headspace:

Examples

Block distracting communications tools:
hammerspoon://setBlacklist?tags=communication,distraction&apps=Mail,Messages

Only permit applications tagged writing, and quit any other apps for a Hemingway writing session:
hammerspoon://setWhitelist?tags=writing&kill=true

Install

  1. MacOS
  2. Hammerspoon installed
  3. Download a release to ~/.hammerspoon/Spoons/Headspace.spoon
  4. Load the Spoon by adding the following code snippet to ~/.hammerspoon/init.lua:
hs.loadSpoon('Headspace'):start()

Looking for the old version?

The older version (integrated UI chooser and toggl tracker) is available for viewing here: Version 1.1.4

headspace.spoon's People

Contributors

evantravers avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.