This was inspired by discussion in MPU #480, specific to Toggl and Fluid. Extracting Toggl from the browser sounds lovely.
After browsing Fluid and Epichrome a bit, I settled on using Nativefier to spin up a nice little Toggl Electron app.
Here’s the script I used to create the app:
npm nativefier --name "Toggl Timer" https://toggl.com/app/timer/ --show-menu-bar --basic-auth-username "EMAIL@EMAIL.COM" --basic-auth-password "1PASSWORDSTUFFS"
Awesome. A local Toggl app
–
Because ADHD, I also created a Keyboard Maestro macro which runs this logic:
When I press the key on my BT keyboard, check if the Toggl app is at the front. If yes, start a new timer. If not, focus the app. I never thought this button would be cool! Unfortunately it appears we can’t grab control over the play key on the native keyboard, so I added a typed string trigger as well. Less cool.
To start the timer I’m running a Toggl API CURL via Keyboard Maestro, with blank everything. I’d prefer to run JSX on the Start/Stop button within the app but couldn’t figure that out.
ByeTunes
There’s one other step needed so iTunes doesn’t hijack the play button and launch itself. Thanks to Justin Pot @ HowToGeek.com for the script:
launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist
https://overcast.fm/+FrCFFZA8A
https://github.com/jiahaog/nativefier/blob/master/docs/api.md
https://github.com/toggl/toggl_api_docs/blob/master/chapters/time_entries.md#start-a-time-entry
https://www.howtogeek.com/author/justinpot/
https://www.howtogeek.com/274345/stop-itunes-from-launching-when-you-press-play-on-your-macs-keyboard/
@RosemaryOrchard thought you might dig this one