diff options
| author | Robert Günzler <r@gnzler.io> | 2026-02-10 12:32:48 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2026-02-10 12:41:25 +0100 |
| commit | 63feeb9f369fc6176e85c1c2d8fcc863caad1946 (patch) | |
| tree | 41cd5d2d1ec36e74e464caab722cc9b460153f04 /.config/waybar/modules/toggl.lua | |
| parent | 5bd0a4aca65ecb9818ef1285982d160b6b6ff665 (diff) | |
start new
Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to '.config/waybar/modules/toggl.lua')
| -rwxr-xr-x | .config/waybar/modules/toggl.lua | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/.config/waybar/modules/toggl.lua b/.config/waybar/modules/toggl.lua deleted file mode 100755 index 7c9f0b9..0000000 --- a/.config/waybar/modules/toggl.lua +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env luajit - -TOKEN = os.getenv("TOGGL_TOKEN") -if not TOKEN then - io.stderr:write("need TOGGL_TOKEN\n") - os.exit(1) -end - -function timer_duration() - cmd = string.format('toggl -t %s -j timer ls | jq -r ".[0].duration"', TOKEN) - local f = assert(io.popen(cmd, 'r')) - local s = assert(f:read('*a')) - f:close() - if not (s == '') then - return tonumber(s) - end -end - -unix_time = os.time() - -diff = timer_duration() -if not diff then - os.exit(0) -end - -d = unix_time + diff - -print(string.format('%dh %.2dm', d/(60*60), d/60%60)) |