mirror of
https://forge.katzen.cafe/schrottkatze/nix-configs.git
synced 2024-12-03 17:58:45 +01:00
add event counter to shell startup
This commit is contained in:
parent
bb3ed01418
commit
e603b5ecd5
|
@ -48,7 +48,21 @@ def flag [
|
|||
|
||||
def main [] {
|
||||
print (flag $TRANS);
|
||||
print $"(ansi attr_bold) Hi jade, you're on HRT for ((date now) - ('2024-02-18T20:53' | into datetime) | format duration month)s now!";
|
||||
let next_events = open ~/Docs/dates.csv
|
||||
| update datetime {|ev| $ev.datetime | into datetime }
|
||||
| sort-by datetime
|
||||
| first
|
||||
| each {|ev| $"(ansi attr_bold)($ev.event)(ansi reset) in (ansi attr_bold)(tfmt ($ev.datetime - (date now)))s(ansi reset)" };
|
||||
print $"Hi jade, you're on HRT for (ansi reset)(ansi attr_bold)((date now) - ('2024-02-18T20:53' | into datetime) | format duration month)s(ansi reset) now! | Next Event: ($next_events)";
|
||||
# print (flag $LESBIAN);
|
||||
}
|
||||
|
||||
def tfmt [dur: duration] {
|
||||
if ($dur < 1hr) {
|
||||
return ($dur | format duration min);
|
||||
} else if ($dur < 1day) {
|
||||
return ($dur | format duration hr);
|
||||
} else {
|
||||
return ($dur | format duration day);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue