fix shell startup shit

This commit is contained in:
Schrottkatze 2025-01-01 03:17:22 +01:00
parent f8a322ca8e
commit 96a2acd8cd
No known key found for this signature in database

View file

@ -39,10 +39,10 @@ def flag [
let amount = $rest / 2;
$cols = ($cols | update 0 { $in | update width {|w| ($w.width + $amount) } } | update $last { $in | update width {|w| ($w.width + $amount) } });
$cols = ($cols | update 0 { $in | update width {|w| (($w.width | into int) + $amount) } } | update $last { $in | update width {|w| ($w.width + $amount) } });
$cols | each {|col|
$character | std repeat $col.width | prepend (ansi {fg: $"#($col.color)" }) | str join
$character | std repeat ($col.width | into int) | prepend (ansi {fg: $"#($col.color)" }) | str join
} | prepend (ansi attr_bold) | append (ansi reset) | str join
}
@ -51,10 +51,14 @@ def main [] {
let next_events = open ~/Docs/dates.csv
| update datetime {|ev| $ev.datetime | into datetime }
| sort-by datetime
| filter {|ev| ($ev.datetime > (date now))}
| 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)";
| filter {|ev| ($ev.datetime > (date now))};
let evstr = if ($next_events | is-not-empty) {
let ev = $next_events | first;
$" | Next Event: (ansi attr_bold)($ev.event)(ansi reset) in (ansi attr_bold)(tfmt ($ev.datetime - (date now)))s(ansi reset)"
} else "";
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!($evstr)";
}
def tfmt [dur: duration] {