summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2025-02-21 10:33:07 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2025-02-21 10:33:07 +0100
commit2ae5235dd0ccba31fde53b8919ae5eb5e4186563 (patch)
treef8db8035d5dcbfc2ffdc6851e7fd2a32c8b0595e
parente6d6685ea0e04a20a2558973c326749d5fba582a (diff)
downloadnixos-2ae5235dd0ccba31fde53b8919ae5eb5e4186563.tar
nixos-2ae5235dd0ccba31fde53b8919ae5eb5e4186563.tar.gz
nixos-2ae5235dd0ccba31fde53b8919ae5eb5e4186563.tar.bz2
nixos-2ae5235dd0ccba31fde53b8919ae5eb5e4186563.tar.xz
nixos-2ae5235dd0ccba31fde53b8919ae5eb5e4186563.zip
...
-rw-r--r--accounts/gkleen@sif/niri/mako.nix4
-rwxr-xr-xoverlays/worktime/worktime/__main__.py11
2 files changed, 11 insertions, 4 deletions
diff --git a/accounts/gkleen@sif/niri/mako.nix b/accounts/gkleen@sif/niri/mako.nix
index 0a10555a..2788fb82 100644
--- a/accounts/gkleen@sif/niri/mako.nix
+++ b/accounts/gkleen@sif/niri/mako.nix
@@ -27,6 +27,10 @@
27 [app-name=Element] 27 [app-name=Element]
28 group-by=summary 28 group-by=summary
29 29
30 [app-name=poweralertd]
31 ignore-timeout=1
32 default-timeout=2000
33
30 [mode=silent] 34 [mode=silent]
31 invisible=1 35 invisible=1
32 ''; 36 '';
diff --git a/overlays/worktime/worktime/__main__.py b/overlays/worktime/worktime/__main__.py
index 16769953..d458ffdb 100755
--- a/overlays/worktime/worktime/__main__.py
+++ b/overlays/worktime/worktime/__main__.py
@@ -644,14 +644,17 @@ def time_worked(now, waybar, **args):
644 644
645 clockout_time, exact_clockout_time, clockout_difference = round_clockout_time(difference) 645 clockout_time, exact_clockout_time, clockout_difference = round_clockout_time(difference)
646 clockout_time_pull_forward, exact_clockout_time_pull_forward, clockout_difference_pull_forward = round_clockout_time(difference_pull_forward) 646 clockout_time_pull_forward, exact_clockout_time_pull_forward, clockout_difference_pull_forward = round_clockout_time(difference_pull_forward)
647 clockout_pull_forward_sum = now.now + now.time_to_work - now.time_worked + sum(now.pull_forward.values(), start=timedelta(milliseconds=0))
648
647 if now.running_entry and clockout_time and (clockout_difference >= 0 or clockout_difference_pull_forward >= 0): 649 if now.running_entry and clockout_time and (clockout_difference >= 0 or clockout_difference_pull_forward >= 0):
648 out_text = f"{difference_string}/{clockout_time:%H:%M}" 650 out_text = f"{difference_string}/{clockout_time:%H:%M}"
649 tooltip = f"{tooltip_timedelta(worked)}/{exact_clockout_time:%H:%M:%S}" 651 tooltip = f"{tooltip_timedelta(worked)}/{exact_clockout_time:%H:%M:%S}"
650 652
651 if clockout_time_pull_forward != clockout_time: 653 if clockout_pull_forward_sum > exact_clockout_time_pull_forward:
652 out_text += f"…{clockout_time_pull_forward:%H:%M}" 654 if clockout_time_pull_forward != clockout_time:
653 if exact_clockout_time_pull_forward != exact_clockout_time: 655 out_text += f"…{clockout_time_pull_forward:%H:%M}"
654 tooltip += f"…{exact_clockout_time_pull_forward:%H:%M:%S}" 656 if exact_clockout_time_pull_forward != exact_clockout_time:
657 tooltip += f"…{exact_clockout_time_pull_forward:%H:%M:%S}"
655 else: 658 else:
656 out_text = difference_string 659 out_text = difference_string
657 else: 660 else: