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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
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);
defer allocator.free(cpuq);
const kernel = try stat.getkernel(allocator);
defer allocator.free(kernel);
const osd = try stat.getos(allocator);
defer allocator.free(osd);
const ram = try stat.ramInfo(allocator);
defer allocator.free(ram);
const hst = try stat.gethst(allocator);
defer allocator.free(hst);
const ge = try stat.GetRam(allocator);
defer allocator.free(ge);
const user = try stat.users(allocator);
defer allocator.free(user);
const trm = try stat.uptime(allocator);
defer allocator.free(trm);
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} User@hostname: {s}@{s}\n", .{ art[3], user, 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 });
try stdout.print(" uptime: {s}\n", .{trm});
}
|