⌚ get the total working hours of the current week with the toggl-week
command:
$ toggl-week
$ You've worked 38 hours, 55 minutes and 46 seconds this week.
- Download
toggl.plugin.zsh
or clone this repository:
git clone https://github.com/natterstefan/toggl-zsh-plugin.git
- source the script at the end of
~/.zshrc
:
source /path/to/toggl-zsh-plugin/toggl.plugin.zsh
- source
~/.zshrc
to take changes into account:
source ~/.zshrc
- Clone the repo in "Oh My ZSH" plugins directory:
git clone https://github.com/natterstefan/toggl-zsh-plugin.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/toggl
- Activate the plugin in
~/.zshrc
by addingtoggl
to the plugins section:
plugins=( [plugins...] toggl)
- source
~/.zshrc
to take changes into account:
source ~/.zshrc
Having antigen properly installed, just run:
antigen natterstefan/toggl-zsh-plugin
Add the following environment variables to your ~/.zshrc
:
# open https://toggl.com/app/workspaces. Select the workspace you want to use,
# click on the three dots and open "Settings". Get the id from the URL in your
# browser. Eg. https://toggl.com/app/workspaces/12345678/settings?
export TOGGL_WORKSPACE_ID="12345678"
# open https://www.toggl.com/app/projects and select the project(s) you want to
# use in the report. Again copy the id from the url. In this case
# https://www.toggl.com/app/projects/12345678/edit/98765 the id would be 98765.
# This value can look like: "98765" or "98765,43210" for multiple project ids.
export TOGGL_PROJECT_IDS="98765"
# open https://toggl.com/app/profile and get the API token from the bottom of
# the page
export TOGGL_API_TOKEN="eNw1y5uVyYfW3aSVhHDZCcyAZGDfvezi1DmxjVXo"
git clone https://github.com/natterstefan/toggl-zsh-plugin.git
mkdir ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/toggl
ls -s toggl.plugin.zsh ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/toggl/toggl.plugin.zsh
You are now ready to develop. After changing your code, you need to restart the
terminal or source ~/.zshrc
again. Don't forget to remove the symlink, in case
you start from Installation again.
If this does not work, I recommend to create tmp/test.sh
and make it
executable. Then copy and paste the code from toggl.plugin.zsh
into the file. Now, make changes and test it with ./tmp/test.sh
. Once you are
done, copy the code back into toggl.plugin.zsh
.
- Oh My ZSH!
- Oh My ZSH! - Customization
- Toggl API Docs - Reports
- Toggl API Docs - Authentication
- Working with JSON in bash using
jq
This extension is not affiliated, associated, authorized, endorsed by or in any way officially connected to Toggl (toggl.com).
Stefan Natter |