nya
This commit is contained in:
parent
26d3b94a3b
commit
36b3429c2c
|
@ -162,37 +162,37 @@ pub const MemoryWidget = struct {
|
||||||
formatMemoryPercent(allocator, memInfo.swapPercent),
|
formatMemoryPercent(allocator, memInfo.swapPercent),
|
||||||
});
|
});
|
||||||
} else if (self.lc.get() == 2) {
|
} else if (self.lc.get() == 2) {
|
||||||
text = try std.fmt.allocPrint(allocator, "{} {d:0<2} MB", .{
|
text = try std.fmt.allocPrint(allocator, "{} {d:0>2} MB", .{
|
||||||
comptimeColour("accentlight", "mem free"),
|
comptimeColour("accentlight", "mem free"),
|
||||||
kibibytesToMegabytes(memInfo.memFree),
|
kibibytesToMegabytes(memInfo.memFree),
|
||||||
});
|
});
|
||||||
} else if (self.lc.get() == 3) {
|
} else if (self.lc.get() == 3) {
|
||||||
text = try std.fmt.allocPrint(allocator, "{} {d:0<2} MB", .{
|
text = try std.fmt.allocPrint(allocator, "{} {d:0>2} MB", .{
|
||||||
comptimeColour("accentlight", "swap free"),
|
comptimeColour("accentlight", "swap free"),
|
||||||
kibibytesToMegabytes(memInfo.swapFree),
|
kibibytesToMegabytes(memInfo.swapFree),
|
||||||
});
|
});
|
||||||
} else if (self.lc.get() == 4) {
|
} else if (self.lc.get() == 4) {
|
||||||
text = try std.fmt.allocPrint(allocator, "{} {d:0<2} MB", .{
|
text = try std.fmt.allocPrint(allocator, "{} {d:0>2} MB", .{
|
||||||
comptimeColour("accentlight", "mem used"),
|
comptimeColour("accentlight", "mem used"),
|
||||||
kibibytesToMegabytes(memInfo.memUsed),
|
kibibytesToMegabytes(memInfo.memUsed),
|
||||||
});
|
});
|
||||||
} else if (self.lc.get() == 5) {
|
} else if (self.lc.get() == 5) {
|
||||||
text = try std.fmt.allocPrint(allocator, "{} {d:0<2} MB", .{
|
text = try std.fmt.allocPrint(allocator, "{} {d:0>2} MB", .{
|
||||||
comptimeColour("accentlight", "swap used"),
|
comptimeColour("accentlight", "swap used"),
|
||||||
kibibytesToMegabytes(memInfo.swapUsed),
|
kibibytesToMegabytes(memInfo.swapUsed),
|
||||||
});
|
});
|
||||||
} else if (self.lc.get() == 6) {
|
} else if (self.lc.get() == 6) {
|
||||||
text = try std.fmt.allocPrint(allocator, "{} {d:0<2} MB", .{
|
text = try std.fmt.allocPrint(allocator, "{} {d:0>2} MB", .{
|
||||||
comptimeColour("accentlight", "mem cache"),
|
comptimeColour("accentlight", "mem cache"),
|
||||||
kibibytesToMegabytes(memInfo.cached),
|
kibibytesToMegabytes(memInfo.cached),
|
||||||
});
|
});
|
||||||
} else if (self.lc.get() == 7) {
|
} else if (self.lc.get() == 7) {
|
||||||
text = try std.fmt.allocPrint(allocator, "{} {d:0<2} MB", .{
|
text = try std.fmt.allocPrint(allocator, "{} {d:0>2} MB", .{
|
||||||
comptimeColour("accentlight", "swap cache"),
|
comptimeColour("accentlight", "swap cache"),
|
||||||
kibibytesToMegabytes(memInfo.swapCached),
|
kibibytesToMegabytes(memInfo.swapCached),
|
||||||
});
|
});
|
||||||
} else if (self.lc.get() == 8) {
|
} else if (self.lc.get() == 8) {
|
||||||
text = try std.fmt.allocPrint(allocator, "{} {d:0<2} MB", .{
|
text = try std.fmt.allocPrint(allocator, "{} {d:0>2} MB", .{
|
||||||
comptimeColour("accentlight", "mem buf"),
|
comptimeColour("accentlight", "mem buf"),
|
||||||
kibibytesToMegabytes(memInfo.buffers),
|
kibibytesToMegabytes(memInfo.buffers),
|
||||||
});
|
});
|
||||||
|
|
|
@ -46,11 +46,11 @@ pub const TimeWidget = struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
var timeStr = try std.fmt.allocPrint(allocator, "{}{}{}{}{}{}", .{
|
var timeStr = try std.fmt.allocPrint(allocator, "{}{}{}{}{}{}", .{
|
||||||
colour(allocator, "red", try std.fmt.allocPrint(allocator, "{d:0<2}", .{@intCast(u7, hour)})),
|
colour(allocator, "red", try std.fmt.allocPrint(allocator, "{d:0>2}", .{@intCast(u7, hour)})),
|
||||||
comptimeColour("accentlight", ":"),
|
comptimeColour("accentlight", ":"),
|
||||||
colour(allocator, "orange", try std.fmt.allocPrint(allocator, "{d:0<2}", .{@intCast(u7, clock.min)})),
|
colour(allocator, "orange", try std.fmt.allocPrint(allocator, "{d:0>2}", .{@intCast(u7, clock.min)})),
|
||||||
comptimeColour("accentmedium", ":"),
|
comptimeColour("accentmedium", ":"),
|
||||||
colour(allocator, "yellow", try std.fmt.allocPrint(allocator, "{d:0<2}", .{@intCast(u7, clock.sec)})),
|
colour(allocator, "yellow", try std.fmt.allocPrint(allocator, "{d:0>2}", .{@intCast(u7, clock.sec)})),
|
||||||
colour(allocator, "accentdark", end),
|
colour(allocator, "accentdark", end),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue