mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-12-13 13:02:58 +01:00
add uname info to mzteinit
This commit is contained in:
parent
551c33f37c
commit
66409997fd
1 changed files with 14 additions and 6 deletions
|
@ -21,16 +21,23 @@ pub fn main() !void {
|
|||
|
||||
fn ui(buf_writer: anytype) !run.Command {
|
||||
const w = buf_writer.writer();
|
||||
var style: ?at.style.Style = null;
|
||||
|
||||
try @import("figlet.zig").writeFiglet(w);
|
||||
try w.writeAll(
|
||||
\\
|
||||
\\What do you want to do?
|
||||
\\
|
||||
\\
|
||||
const uname = std.os.uname();
|
||||
try updateStyle(w, .{ .foreground = .Yellow }, &style);
|
||||
try w.print(
|
||||
"\n {s} {s} {s}\n\n",
|
||||
.{
|
||||
uname.nodename,
|
||||
uname.release,
|
||||
uname.machine,
|
||||
},
|
||||
);
|
||||
|
||||
var style: ?at.style.Style = null;
|
||||
try updateStyle(w, .{ .font_style = .{ .bold = true } }, &style);
|
||||
try w.writeAll(" What do you want to do?\n\n");
|
||||
|
||||
for (std.enums.values(run.Command)) |tag| {
|
||||
try updateStyle(w, .{ .foreground = .Cyan }, &style);
|
||||
try w.print("[{c}] ", .{tag.char()});
|
||||
|
@ -38,6 +45,7 @@ fn ui(buf_writer: anytype) !run.Command {
|
|||
try w.print("{s}\n", .{@tagName(tag)});
|
||||
}
|
||||
try at.format.resetStyle(w);
|
||||
style = .{};
|
||||
|
||||
try buf_writer.flush();
|
||||
|
||||
|
|
Loading…
Reference in a new issue