about summary refs log tree commit diff
path: root/pkgs/profpatsch/display-infos
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2020-06-02 21:53:10 +0200
committerProfpatsch <mail@profpatsch.de>2020-06-02 21:53:19 +0200
commitb9f9281281daaf10b9af500a2f92247381199d0b (patch)
tree702c03b22776ad64e8f6a66134045f90095d0aa5 /pkgs/profpatsch/display-infos
parentb97e01169ed753e3cc7b4b09ce3bf3537b6f638a (diff)
pkgs/profpatsch/display-infos: add dottime
https://dotti.me/

DOT-TIME(7)                      TIME FORMATS                      DOT-TIME(7)

NAME
       dot-time - a universal convention for conveying time

DESCRIPTION
       For  those  of us who travel often or coordinate across many timezones,
       working with local time is frequently impractical. ISO8601, in all  its
       wisdom,  allows  for  time  zone  designators, but still represents the
       hours and minutes as  local  time,  thus  making  it  inconvenient  for
       quickly comparing timestamps from different locations.

       Dot  time  instead uses UTC for all date, hour, and minute indications,
       and while it allows for time zone designators, they are optional infor‐
       mation that can be dropped without changing the indicated time. It uses
       an alternate hour separator to make it easy to distinguish from regular
       ISO8601. When a time zone designator is provided, one can easily obtain
       the matching local time by adding the UTC offset to the UTC time.

EXAMPLES
       These timestamps all represent the same point in time.

       ┌─────────────────────┬─────────────────────┐
       │ dot time            │ ISO8601             │
       ├─────────────────────┼─────────────────────┤
       │ 2019-06-19T22·13-04 │ 2019-06-19T18:13-04 │
       ├─────────────────────┼─────────────────────┤
       │ 2019-06-19T22·13+00 │ 2019-06-19T22:13+00 │
       ├─────────────────────┼─────────────────────┤
       │ 2019-06-19T22·13+02 │ 2019-06-20T00:13+02 │
       └─────────────────────┴─────────────────────┘

                                  2019-06-19                       DOT-TIME(7)
Diffstat (limited to 'pkgs/profpatsch/display-infos')
-rw-r--r--pkgs/profpatsch/display-infos/default.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/profpatsch/display-infos/default.nix b/pkgs/profpatsch/display-infos/default.nix
index b8bb2a07..e6752242 100644
--- a/pkgs/profpatsch/display-infos/default.nix
+++ b/pkgs/profpatsch/display-infos/default.nix
@@ -49,13 +49,15 @@ let
     ac = "🗲 " if charging else ""
     sft_remaining = seconds_to_sft(seconds_remaining)
     date = sub.run(["date", "+%d.%m. %a %T"], stdout=sub.PIPE).stdout.strip().decode()
+    dottime = sub.run(["date", "--utc", "+%H·%M"], stdout=sub.PIPE).stdout.strip().decode()
     sftdate = sub.run(["@sfttime@"], stdout=sub.PIPE).stdout.strip().decode()
-    notify = "BAT: {percent}% {ac}{charge}| {date} | {sftdate}".format(
+    notify = "BAT: {percent}% {ac}{charge}| {date} | {sftdate} | {dottime}".format(
       percent = int(bat*100),
       ac = ac,
       charge = "{} ".format(sft_remaining) if seconds_remaining else "",
       date = date,
-      sftdate = sftdate
+      sftdate = sftdate,
+      dottime = dottime
     )
     print(notify)
   '';