wip: color scheme

This commit is contained in:
Kalle Carlbark 2024-09-04 07:25:24 +02:00
parent 0d1b3f5b7d
commit 42db065ac5
No known key found for this signature in database

View file

@ -87,6 +87,7 @@ pub fn main() !void {
// }, // },
// }, // },
}); });
// const logo_text_win = win.child(.{ .y_off = dims.rows });
var user_buf: [64]u8 = undefined; var user_buf: [64]u8 = undefined;
const user = try sys.get_user(&user_buf); const user = try sys.get_user(&user_buf);
var hostname_buf: [std.posix.HOST_NAME_MAX]u8 = undefined; var hostname_buf: [std.posix.HOST_NAME_MAX]u8 = undefined;
@ -105,7 +106,7 @@ pub fn main() !void {
.y_off = 1, .y_off = 1,
.x_off = dims.cols + 1, .x_off = dims.cols + 1,
.width = .{ .limit = 40 }, .width = .{ .limit = 40 },
.height = .{ .limit = 6 }, .height = .{ .limit = 10 },
.border = .{ .border = .{
.where = .{ .where = .{
.other = border_locations, .other = border_locations,
@ -151,7 +152,7 @@ pub fn main() !void {
.text = " OS", .text = " OS",
.style = .{ .style = .{
.fg = .{ .fg = .{
.index = 2, .index = 7,
}, },
.bold = true, .bold = true,
}, },
@ -161,7 +162,7 @@ pub fn main() !void {
.text = " Kernel", .text = " Kernel",
.style = .{ .style = .{
.fg = .{ .fg = .{
.index = 2, .index = 7,
}, },
.bold = true, .bold = true,
}, },
@ -171,7 +172,7 @@ pub fn main() !void {
.text = " Uptime", .text = " Uptime",
.style = .{ .style = .{
.fg = .{ .fg = .{
.index = 2, .index = 7,
}, },
.bold = true, .bold = true,
}, },
@ -181,7 +182,7 @@ pub fn main() !void {
.text = " CPU", .text = " CPU",
.style = .{ .style = .{
.fg = .{ .fg = .{
.index = 2, .index = 7,
}, },
.bold = true, .bold = true,
}, },
@ -191,7 +192,7 @@ pub fn main() !void {
.text = " Shell", .text = " Shell",
.style = .{ .style = .{
.fg = .{ .fg = .{
.index = 2, .index = 7,
}, },
.bold = true, .bold = true,
}, },
@ -201,14 +202,148 @@ pub fn main() !void {
.text = " Terminal", .text = " Terminal",
.style = .{ .style = .{
.fg = .{ .fg = .{
.index = 2, .index = 7,
}, },
.bold = true, .bold = true,
}, },
}, },
.{ .text = current_terminal }, .{ .text = current_terminal },
.{
.text = " ▂▂▂",
.style = .{
.fg = .{
.index = 0,
},
},
},
.{
.text = " ▂▂▂",
.style = .{
.fg = .{
.index = 1,
},
},
},
.{
.text = " ▂▂▂",
.style = .{
.fg = .{
.index = 2,
},
},
},
.{
.text = " ▂▂▂",
.style = .{
.fg = .{
.index = 3,
},
},
},
.{
.text = " ▂▂▂",
.style = .{
.fg = .{
.index = 4,
},
},
},
.{
.text = " ▂▂▂",
.style = .{
.fg = .{
.index = 5,
},
},
},
.{
.text = " ▂▂▂",
.style = .{
.fg = .{
.index = 6,
},
},
},
.{
.text = " ▂▂▂\n",
.style = .{
.fg = .{
.index = 7,
},
},
},
.{
.text = " ▂▂▂",
.style = .{
.fg = .{
.index = 8,
},
},
},
.{
.text = " ▂▂▂",
.style = .{
.fg = .{
.index = 9,
},
},
},
.{
.text = " ▂▂▂",
.style = .{
.fg = .{
.index = 10,
},
},
},
.{
.text = " ▂▂▂",
.style = .{
.fg = .{
.index = 11,
},
},
},
.{
.text = " ▂▂▂",
.style = .{
.fg = .{
.index = 12,
},
},
},
.{
.text = " ▂▂▂",
.style = .{
.fg = .{
.index = 13,
},
},
},
.{
.text = " ▂▂▂",
.style = .{
.fg = .{
.index = 14,
},
},
},
.{
.text = " ▂▂▂",
.style = .{
.fg = .{
.index = 15,
},
},
},
}; };
// const logo_text = [_]vaxis.Cell.Segment{
// .{
// .text = " hello",
// },
// };
try koko.draw(logo_win, .{}); try koko.draw(logo_win, .{});
// _ = try logo_text_win.print(&logo_text, .{});
// try root.kitty_image_inline_copy(allocator, tty.anyWriter(), "/Users/kc/Sync/Images/apple-dark.png"); // try root.kitty_image_inline_copy(allocator, tty.anyWriter(), "/Users/kc/Sync/Images/apple-dark.png");
result = try whoami_win.print(&whoami_info, .{ .wrap = .word }); result = try whoami_win.print(&whoami_info, .{ .wrap = .word });