1
0
Fork 0
This commit is contained in:
namedkitten 2020-10-10 20:09:01 +01:00
parent 26d3b94a3b
commit 36b3429c2c
2 changed files with 10 additions and 10 deletions

View file

@ -162,37 +162,37 @@ pub const MemoryWidget = struct {
formatMemoryPercent(allocator, memInfo.swapPercent),
});
} 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"),
kibibytesToMegabytes(memInfo.memFree),
});
} 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"),
kibibytesToMegabytes(memInfo.swapFree),
});
} 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"),
kibibytesToMegabytes(memInfo.memUsed),
});
} 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"),
kibibytesToMegabytes(memInfo.swapUsed),
});
} 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"),
kibibytesToMegabytes(memInfo.cached),
});
} 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"),
kibibytesToMegabytes(memInfo.swapCached),
});
} 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"),
kibibytesToMegabytes(memInfo.buffers),
});

View file

@ -46,11 +46,11 @@ pub const TimeWidget = struct {
}
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", ":"),
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", ":"),
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),
});