Skip to content

Instantly share code, notes, and snippets.

@zhiyelee
Created June 7, 2020 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhiyelee/b8e7d8c73906474b44e63d3963e431bc to your computer and use it in GitHub Desktop.
Save zhiyelee/b8e7d8c73906474b44e63d3963e431bc to your computer and use it in GitHub Desktop.
Hammerspoon: start RescueTime Focus on with shortcuts
--- start resucueTime FocusTime session
function start_focus_time(duration)
return function()
local focusTimeURLTpl = "https://www.rescuetime.com/anapi/start_focustime?key=%s&duration=%d"
local RESCUETIME_KEY = 'YOUR_RESCUETIME_APIKEY'
hs.http.post(string.format(focusTimeURLTpl, RESCUETIME_KEY, duration))
end
end
hs.hotkey.bind({"alt", "shift"}, "f", start_focus_time(30))
--- end rescueTime focus time
@chadfurman
Copy link

Ah, really nice! I just sent in a feature request for keybindings, but this is such a clever work-around. Use the API! Great idea <3

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