From b9f9281281daaf10b9af500a2f92247381199d0b Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 2 Jun 2020 21:53:10 +0200 Subject: pkgs/profpatsch/display-infos: add dottime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- pkgs/profpatsch/display-infos/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pkgs/profpatsch/display-infos') 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) ''; -- cgit 1.4.1