summaryrefslogtreecommitdiff
path: root/src/main.zig
blob: 8fe11e407041432f7f54ec1cb0825e2d5ad93d38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const std = @import("std");
const stat = @import("stat.zig");
const artd = @import("art.zig");

pub fn main() !void {
    const stdout = std.io.getStdOut().writer();
    var gpa = std.heap.GeneralPurposeAllocator(.{}){};
      defer _ = gpa.deinit();
    const allocator = gpa.allocator();

    const cpuq = try stat.getcput(allocator);
    const kernel = try stat.getkernel(allocator);
    const osd = try stat.getos(allocator);
    const ram = try stat.ramInfo(allocator);
    const hst = try stat.gethst(allocator);
    const ge = try stat.GetRam(allocator);
    defer allocator.free(ge);
    defer allocator.free(ram);
    defer allocator.free(hst);
    defer allocator.free(osd);
    defer allocator.free(cpuq);
    defer allocator.free(kernel);
    const art = artd.logo;
    try stdout.print("{s}      Ezfetch\n", .{art[0]});
      try stdout.print("{s}    -----------------\n", .{art[1]});
      try stdout.print("{s}     Os: {s}\n", .{art[2], osd});
      try stdout.print("{s}    Hostname: {s}\n", .{art[3], hst});
      try stdout.print("{s}    Kernel: {s}\n", .{art[4], kernel});
      try stdout.print("{s}    Cpu: {s}\n", .{art[5], cpuq});
      try stdout.print("            Ram: {s} / {s} \n", .{ge, ram});
}