Show how many hours you've logged in Toggl for the current week in the macOS toolbar using xbar.
Thanks Pawel and Shep for the idea and code to change the color of hours as you approach your limit, and for adding minutes count.
xbar lets you "put anything in your macOS menu bar" (formerly known as Bitbar). Toggl is web-based time tracking software. This xbar plugin lets you see the hours you've logged this week across one or more Toggl workspaces.
The setup steps will walk you through setting these up if you don't already have them.
- Download and install xbar.
- Install
jqwithbrew install jq - Install via xbar here or clone this repo and copy toggl.10m.sh into your xbar plugins folder, which is
~/Library/Application Support/xbar/plugins. - Refresh xbar by clicking on the xbar icon in the toolbar and clicking "Refresh all".
- Click on the plugin in the toolbar, which by default will display "0h", then click on xbar > Open plugin.
- Enter Toggl workspace IDs in the Workspaces field. You can enter more than one, separated by spaces. You can find your workspace ID by navigating to https://track.toggl.com/organization and clicking on the workspace(s) you wish to track. The workspace ID is the ID after
/workspace/in the settings URL. For example, in the URLhttps://track.toggl.com/organization/123/workspaces/456/settings, the workspace ID is456. - Enter a Toggl API key by navigating to https://track.toggl.com/profile and finding the API token section at the bottom of the page.
- Optionally, change the "Week start day".
- Refresh the plugin by clicking on the refresh icon at the top of the plugin dialog, or by clicking on the xbar icon and then xbar > Refresh.
The plugin will automatically refresh every 10 minutes, which is configurable by changing the plugin filename.
