diff options
| author | Robert Günzler <r@gnzler.io> | 2022-09-28 19:37:31 +0200 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2022-09-28 19:37:31 +0200 |
| commit | 1bfc8f9f3620c80115ceb0ad828b4c47368b6278 (patch) | |
| tree | 7530743bcc0c9e3548b363e12399a86591ef2f3c | |
| parent | abcee6e67da956619192339199fdc625491fde39 (diff) | |
waybar: make timetracked module interactive
| -rwxr-xr-x | .config/waybar/modules/timetracked.sh | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/.config/waybar/modules/timetracked.sh b/.config/waybar/modules/timetracked.sh index 4963ea0..52611a3 100755 --- a/.config/waybar/modules/timetracked.sh +++ b/.config/waybar/modules/timetracked.sh @@ -1,10 +1,19 @@ #!/bin/sh set -e +[ -n "$DEBUG" ] && set -x + +case "$1" in +on-click) + timetrace status >/dev/null && timetrace stop + exit 0 + ;; + +*) ;; +esac while true; do timetrace status -o json | - jq -c 'if .project == "---" then {} else { text: (["", .trackedTimeToday] | join(" ")), class: "timetracked", alt: "timetracked" } end' - + jq -c 'if .project == "---" then {} else { text: (["▶", .trackedTimeToday] | join(" ")), class: "timetracked", alt: "timetracked" } end' 2>/dev/null sleep 30 done |