diff options
-rw-r--r-- | accounts/gkleen@sif/ssh-hosts.nix | 5 | ||||
-rw-r--r-- | flake.lock | 30 | ||||
-rw-r--r-- | hosts/surtr/dns/zones/li.141.soa | 4 | ||||
-rw-r--r-- | hosts/surtr/dns/zones/li.yggdrasil.soa | 5 | ||||
-rwxr-xr-x | overlays/worktime/worktime/__main__.py | 70 |
5 files changed, 57 insertions, 57 deletions
diff --git a/accounts/gkleen@sif/ssh-hosts.nix b/accounts/gkleen@sif/ssh-hosts.nix index 107f1e76..ac930614 100644 --- a/accounts/gkleen@sif/ssh-hosts.nix +++ b/accounts/gkleen@sif/ssh-hosts.nix | |||
@@ -554,9 +554,4 @@ | |||
554 | HostKeyAlgorithms = "+ecdsa-sha2-nistp256"; | 554 | HostKeyAlgorithms = "+ecdsa-sha2-nistp256"; |
555 | }; | 555 | }; |
556 | }; | 556 | }; |
557 | "game01" = | ||
558 | { hostname = "game01.yggdrasil.li"; | ||
559 | user = "factorio"; | ||
560 | identityFile = "~/.ssh/gkleen@sif.midgard.yggdrasil"; | ||
561 | }; | ||
562 | } | 557 | } |
@@ -397,11 +397,11 @@ | |||
397 | "xwayland-satellite-unstable": "xwayland-satellite-unstable" | 397 | "xwayland-satellite-unstable": "xwayland-satellite-unstable" |
398 | }, | 398 | }, |
399 | "locked": { | 399 | "locked": { |
400 | "lastModified": 1739042449, | 400 | "lastModified": 1739136145, |
401 | "narHash": "sha256-9zLFUpEebwhjCgtznsI61gTzefI3+fuXATHUOFzJi5w=", | 401 | "narHash": "sha256-KgADxpdWMVevqNaxpJzlocRU+DclrFSyzvUiGFsARcQ=", |
402 | "owner": "sodiboo", | 402 | "owner": "sodiboo", |
403 | "repo": "niri-flake", | 403 | "repo": "niri-flake", |
404 | "rev": "98e3666a9dc4143cbf93d957a15d749b5acef046", | 404 | "rev": "c5a3826e2bf96f3092b79415e17703a7b194e1a8", |
405 | "type": "github" | 405 | "type": "github" |
406 | }, | 406 | }, |
407 | "original": { | 407 | "original": { |
@@ -431,11 +431,11 @@ | |||
431 | "niri-unstable": { | 431 | "niri-unstable": { |
432 | "flake": false, | 432 | "flake": false, |
433 | "locked": { | 433 | "locked": { |
434 | "lastModified": 1739017614, | 434 | "lastModified": 1739187348, |
435 | "narHash": "sha256-eNiFJzN6o3NYjB5LWtOzrwLFNtl/NshIryWT6dg+6fg=", | 435 | "narHash": "sha256-6upEicgdJH3JaS1oXS+wsgLToU14XL8/aOyL2KcS3KY=", |
436 | "owner": "yalter", | 436 | "owner": "yalter", |
437 | "repo": "niri", | 437 | "repo": "niri", |
438 | "rev": "8f9a9d4878bc0deaabc1878d9670e91945c63042", | 438 | "rev": "c4739895f8d07c13c65361bd2105e186e8d44568", |
439 | "type": "github" | 439 | "type": "github" |
440 | }, | 440 | }, |
441 | "original": { | 441 | "original": { |
@@ -472,11 +472,11 @@ | |||
472 | ] | 472 | ] |
473 | }, | 473 | }, |
474 | "locked": { | 474 | "locked": { |
475 | "lastModified": 1738466368, | 475 | "lastModified": 1739071773, |
476 | "narHash": "sha256-PZhUjtvQZOH3PO0EYdTpQvcqkgkq1NkP2A6w9SPHYsk=", | 476 | "narHash": "sha256-/Ak+Quinhmdxa9m3shjm4lwwwqmzG8zzGhhhhgR1k9I=", |
477 | "owner": "Mic92", | 477 | "owner": "Mic92", |
478 | "repo": "nix-index-database", | 478 | "repo": "nix-index-database", |
479 | "rev": "46a8f5fc9552b776bfc5c5c96ea3bede33f68f52", | 479 | "rev": "895d81b6228bbd50a6ef22f5a58a504ca99763ea", |
480 | "type": "github" | 480 | "type": "github" |
481 | }, | 481 | }, |
482 | "original": { | 482 | "original": { |
@@ -493,11 +493,11 @@ | |||
493 | ] | 493 | ] |
494 | }, | 494 | }, |
495 | "locked": { | 495 | "locked": { |
496 | "lastModified": 1736736253, | 496 | "lastModified": 1739078428, |
497 | "narHash": "sha256-GrktftEfXmmdKOU0yz3QXckDz1ncZ+f4KLU8XnYKYuA=", | 497 | "narHash": "sha256-9Q8lxL99vaTtK/myj+I6vQvzt3uJiCpazq0jovQswGs=", |
498 | "owner": "AshleyYakeley", | 498 | "owner": "AshleyYakeley", |
499 | "repo": "NixVirt", | 499 | "repo": "NixVirt", |
500 | "rev": "9063243af5e6674359a0ff7cec57f02eeacf0cea", | 500 | "rev": "f2e4e9ad0b02bbd80c509b63d27a2f11359c16a8", |
501 | "type": "github" | 501 | "type": "github" |
502 | }, | 502 | }, |
503 | "original": { | 503 | "original": { |
@@ -630,11 +630,11 @@ | |||
630 | }, | 630 | }, |
631 | "nixpkgs-stable_2": { | 631 | "nixpkgs-stable_2": { |
632 | "locked": { | 632 | "locked": { |
633 | "lastModified": 1738843498, | 633 | "lastModified": 1739055578, |
634 | "narHash": "sha256-7x+Q4xgFj9UxZZO9aUDCR8h4vyYut4zPUvfj3i+jBHE=", | 634 | "narHash": "sha256-2MhC2Bgd06uI1A0vkdNUyDYsMD0SLNGKtD8600mZ69A=", |
635 | "owner": "NixOS", | 635 | "owner": "NixOS", |
636 | "repo": "nixpkgs", | 636 | "repo": "nixpkgs", |
637 | "rev": "f5a32fa27df91dfc4b762671a0e0a859a8a0058f", | 637 | "rev": "a45fa362d887f4d4a7157d95c28ca9ce2899b70e", |
638 | "type": "github" | 638 | "type": "github" |
639 | }, | 639 | }, |
640 | "original": { | 640 | "original": { |
diff --git a/hosts/surtr/dns/zones/li.141.soa b/hosts/surtr/dns/zones/li.141.soa index d42b4719..ab117f09 100644 --- a/hosts/surtr/dns/zones/li.141.soa +++ b/hosts/surtr/dns/zones/li.141.soa | |||
@@ -1,7 +1,7 @@ | |||
1 | $ORIGIN 141.li. | 1 | $ORIGIN 141.li. |
2 | $TTL 3600 | 2 | $TTL 3600 |
3 | @ IN SOA ns.yggdrasil.li. hostmaster.yggdrasil.li ( | 3 | @ IN SOA ns.yggdrasil.li. hostmaster.yggdrasil.li ( |
4 | 2024102100 ; serial | 4 | 2025020900 ; serial |
5 | 10800 ; refresh | 5 | 10800 ; refresh |
6 | 3600 ; retry | 6 | 3600 ; retry |
7 | 604800 ; expire | 7 | 604800 ; expire |
@@ -59,5 +59,3 @@ _infinoted._tcp IN SRV 5 0 6523 ymir.yggdrasil.li. | |||
59 | _submission._tcp IN SRV 5 0 25 ymir.yggdrasil.li. | 59 | _submission._tcp IN SRV 5 0 25 ymir.yggdrasil.li. |
60 | _imap._tcp IN SRV 5 0 143 ymir.yggdrasil.li. | 60 | _imap._tcp IN SRV 5 0 143 ymir.yggdrasil.li. |
61 | _imaps._tcp IN SRV 5 0 993 ymir.yggdrasil.li. | 61 | _imaps._tcp IN SRV 5 0 993 ymir.yggdrasil.li. |
62 | |||
63 | _factorio._udp IN SRV 5 0 34197 game01.yggdrasil.li. | ||
diff --git a/hosts/surtr/dns/zones/li.yggdrasil.soa b/hosts/surtr/dns/zones/li.yggdrasil.soa index 9af6232f..face42cf 100644 --- a/hosts/surtr/dns/zones/li.yggdrasil.soa +++ b/hosts/surtr/dns/zones/li.yggdrasil.soa | |||
@@ -1,7 +1,7 @@ | |||
1 | $ORIGIN yggdrasil.li. | 1 | $ORIGIN yggdrasil.li. |
2 | $TTL 3600 | 2 | $TTL 3600 |
3 | @ IN SOA ns.yggdrasil.li. hostmaster.yggdrasil.li ( | 3 | @ IN SOA ns.yggdrasil.li. hostmaster.yggdrasil.li ( |
4 | 2025010300 ; serial | 4 | 2025020900 ; serial |
5 | 10800 ; refresh | 5 | 10800 ; refresh |
6 | 3600 ; retry | 6 | 3600 ; retry |
7 | 604800 ; expire | 7 | 604800 ; expire |
@@ -104,6 +104,3 @@ _infinoted._tcp IN SRV 5 0 6523 ymir.yggdrasil.li. | |||
104 | _submission._tcp IN SRV 5 0 25 ymir.yggdrasil.li. | 104 | _submission._tcp IN SRV 5 0 25 ymir.yggdrasil.li. |
105 | _imap._tcp IN SRV 5 0 143 ymir.yggdrasil.li. | 105 | _imap._tcp IN SRV 5 0 143 ymir.yggdrasil.li. |
106 | _imaps._tcp IN SRV 5 0 993 ymir.yggdrasil.li. | 106 | _imaps._tcp IN SRV 5 0 993 ymir.yggdrasil.li. |
107 | |||
108 | game01 IN A 94.16.107.151 | ||
109 | game01 IN AAAA 2a03:4000:50:13d:34ee:a2ff:fed0:328f | ||
diff --git a/overlays/worktime/worktime/__main__.py b/overlays/worktime/worktime/__main__.py index ba6c5ff6..f0363777 100755 --- a/overlays/worktime/worktime/__main__.py +++ b/overlays/worktime/worktime/__main__.py | |||
@@ -610,40 +610,50 @@ def time_worked(now, waybar, **args): | |||
610 | worked = now.time_worked - then.time_worked | 610 | worked = now.time_worked - then.time_worked |
611 | 611 | ||
612 | out_text = None | 612 | out_text = None |
613 | out_class = "stopped" | 613 | out_class = "running" if now.running_entry else "stopped" |
614 | tooltip = tooltip_timedelta(worked) | 614 | tooltip = tooltip_timedelta(worked) |
615 | target_time = max(then.time_per_day(then.now.date()), now.time_per_day(now.now.date())) if then.time_per_day(then.now.date()) and now.time_per_day(now.now.date()) else (then.time_per_day(then.now.date()) if then.time_per_day(then.now.date()) else now.time_per_day(now.now.date())); | ||
616 | difference = target_time - worked | ||
617 | difference_pull_forward = difference + now.time_pulled_forward | ||
618 | if now.running_entry and difference_pull_forward < timedelta(seconds=0): | ||
619 | out_class = "over" | ||
615 | if args['do_round']: | 620 | if args['do_round']: |
616 | total_minutes_difference = 5 * ceil(worked / timedelta(minutes = 5)) | 621 | total_minutes_difference = 5 * ceil(worked / timedelta(minutes = 5)) |
617 | (hours_difference, minutes_difference) = divmod(abs(total_minutes_difference), 60) | 622 | (hours_difference, minutes_difference) = divmod(abs(total_minutes_difference), 60) |
618 | sign = '' if total_minutes_difference >= 0 else '-' | 623 | sign = '' if total_minutes_difference >= 0 else '-' |
619 | |||
620 | difference_string = f"{sign}" | ||
621 | if hours_difference != 0: | ||
622 | difference_string += f"{hours_difference}h" | ||
623 | if hours_difference == 0 or minutes_difference != 0: | ||
624 | difference_string += f"{minutes_difference}m" | ||
625 | |||
626 | clockout_time = None | ||
627 | clockout_difference = None | ||
628 | if then.now_is_workday or now.now_is_workday: | ||
629 | target_time = max(then.time_per_day(then.now.date()), now.time_per_day(now.now.date())) if then.time_per_day(then.now.date()) and now.time_per_day(now.now.date()) else (then.time_per_day(then.now.date()) if then.time_per_day(then.now.date()) else now.time_per_day(now.now.date())); | ||
630 | difference = target_time - worked | ||
631 | clockout_difference = 5 * ceil(difference / timedelta(minutes = 5)) | ||
632 | clockout_time = now.now + difference | ||
633 | exact_clockout_time = clockout_time | ||
634 | clockout_time += (5 - clockout_time.minute % 5) * timedelta(minutes = 1) | ||
635 | clockout_time = clockout_time.replace(second = 0, microsecond = 0) | ||
636 | 624 | ||
637 | if now.running_entry and clockout_time and clockout_difference >= 0: | 625 | difference_string = f"{sign}" |
638 | out_class = "running" | 626 | if hours_difference != 0: |
639 | out_text = f"{difference_string}/{clockout_time:%H:%M}" | 627 | difference_string += f"{hours_difference}h" |
640 | tooltip = f"{tooltip_timedelta(worked)}/{exact_clockout_time:%H:%M}" | 628 | if hours_difference == 0 or minutes_difference != 0: |
641 | else: | 629 | difference_string += f"{minutes_difference}m" |
642 | if now.running_entry: | 630 | |
643 | out_class = "over" | 631 | def round_clockout_time(difference): |
644 | out_text = difference_string | 632 | clockout_time = None |
633 | clockout_difference = None | ||
634 | if then.now_is_workday or now.now_is_workday: | ||
635 | clockout_difference = 5 * ceil(difference / timedelta(minutes = 5)) | ||
636 | clockout_time = now.now + difference | ||
637 | exact_clockout_time = clockout_time | ||
638 | clockout_time += (5 - clockout_time.minute % 5) * timedelta(minutes = 1) | ||
639 | clockout_time = clockout_time.replace(second = 0, microsecond = 0) | ||
640 | |||
641 | return clockout_time, exact_clockout_time, clockout_difference | ||
642 | |||
643 | clockout_time, exact_clockout_time, clockout_difference = round_clockout_time(difference) | ||
644 | clockout_time_pull_forward, exact_clockout_time_pull_forward, clockout_difference_pull_forward = round_clockout_time(difference_pull_forward) | ||
645 | if now.running_entry and clockout_time and (clockout_difference >= 0 or clockout_difference_pull_forward >= 0): | ||
646 | out_text = f"{difference_string}/{clockout_time:%H:%M}" | ||
647 | tooltip = f"{tooltip_timedelta(worked)}/{exact_clockout_time:%H:%M:%S}" | ||
648 | |||
649 | if clockout_time_pull_forward != clockout_time: | ||
650 | out_text += f"…{clockout_time_pull_forward:%H:%M}" | ||
651 | if exact_clockout_time_pull_forward != exact_clockout_time: | ||
652 | tooltip += f"…{exact_clockout_time_pull_forward:%H:%M:%S}" | ||
653 | else: | ||
654 | out_text = difference_string | ||
645 | else: | 655 | else: |
646 | out_text = str(worked) | 656 | out_text = str(worked) |
647 | 657 | ||
648 | if waybar: | 658 | if waybar: |
649 | json.dump({"text": out_text, "class": out_class, "tooltip": tooltip}, stdout) | 659 | json.dump({"text": out_text, "class": out_class, "tooltip": tooltip}, stdout) |