mirror of
https://forge.katzen.cafe/schrottkatze/nix-configs.git
synced 2025-01-10 00:59:23 +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;
|
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|
|
$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
|
} | prepend (ansi attr_bold) | append (ansi reset) | str join
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,10 +51,14 @@ def main [] {
|
||||||
let next_events = open ~/Docs/dates.csv
|
let next_events = open ~/Docs/dates.csv
|
||||||
| update datetime {|ev| $ev.datetime | into datetime }
|
| update datetime {|ev| $ev.datetime | into datetime }
|
||||||
| sort-by datetime
|
| sort-by datetime
|
||||||
| filter {|ev| ($ev.datetime > (date now))}
|
| 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)" };
|
let evstr = if ($next_events | is-not-empty) {
|
||||||
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)";
|
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] {
|
def tfmt [dur: duration] {
|
||||||
|
|
Loading…
Reference in a new issue