mirror of
https://forge.katzen.cafe/schrottkatze/nix-configs.git
synced 2025-01-09 16:55:51 +01:00
fix shell startup shit
This commit is contained in:
parent
f8a322ca8e
commit
96a2acd8cd
1 changed files with 10 additions and 6 deletions
|
@ -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] {
|
||||
|
|
Loading…
Reference in a new issue