Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b4ec1b6d2d | ||
|
|
cd40fe34d2 | ||
|
|
5e71eaf3f6 | ||
|
|
7ac43a2694 | ||
|
|
d9c68cb9cd | ||
|
|
1865be9030 |
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
// This is a [Semantic Version](https://semver.org/).
|
// This is a [Semantic Version](https://semver.org/).
|
||||||
// In a future version of Zig it will be used for package deduplication.
|
// In a future version of Zig it will be used for package deduplication.
|
||||||
.version = "0.5.0",
|
.version = "0.5.3",
|
||||||
|
|
||||||
// Together with name, this represents a globally unique package
|
// Together with name, this represents a globally unique package
|
||||||
// identifier. This field is generated by the Zig toolchain when the
|
// identifier. This field is generated by the Zig toolchain when the
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ pub fn getDefaultFormattedSwapInfo(allocator: std.mem.Allocator) ![]u8 {
|
|||||||
pub fn getFormattedSwapInfo(allocator: std.mem.Allocator, key: []const u8, key_color: []const u8) ![]u8 {
|
pub fn getFormattedSwapInfo(allocator: std.mem.Allocator, key: []const u8, key_color: []const u8) ![]u8 {
|
||||||
const swap_info = if (builtin.os.tag == .macos) try detection.hardware.getSwapInfo() else if (builtin.os.tag == .linux) try detection.hardware.getSwapInfo(allocator);
|
const swap_info = if (builtin.os.tag == .macos) try detection.hardware.getSwapInfo() else if (builtin.os.tag == .linux) try detection.hardware.getSwapInfo(allocator);
|
||||||
if (swap_info) |s| {
|
if (swap_info) |s| {
|
||||||
return try std.fmt.allocPrint(allocator, "{s}{s}:{s} {d:.2} / {d:.2} GiB ({}%)", .{ key_color, key, ascii.Reset, s.swap_usage, s.swap_usage, s.swap_usage_percentage });
|
return try std.fmt.allocPrint(allocator, "{s}{s}:{s} {d:.2} / {d:.2} GiB ({}%)", .{ key_color, key, ascii.Reset, s.swap_usage, s.swap_size, s.swap_usage_percentage });
|
||||||
} else {
|
} else {
|
||||||
return try std.fmt.allocPrint(allocator, "{s}{s}:{s} Disabled", .{ key_color, key, ascii.Reset });
|
return try std.fmt.allocPrint(allocator, "{s}{s}:{s} Disabled", .{ key_color, key, ascii.Reset });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,7 +172,6 @@ fn getCpuFreqAppleSilicon() !f64 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: test on intel machine
|
|
||||||
pub fn getCpuFreqIntel() f64 {
|
pub fn getCpuFreqIntel() f64 {
|
||||||
var freq: f64 = 0;
|
var freq: f64 = 0;
|
||||||
var size: usize = @sizeOf(f64);
|
var size: usize = @sizeOf(f64);
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ pub fn main() !void {
|
|||||||
ascii.Yellow,
|
ascii.Yellow,
|
||||||
username,
|
username,
|
||||||
ascii.Reset,
|
ascii.Reset,
|
||||||
ascii.Magenta,
|
ascii.Yellow,
|
||||||
hostname,
|
hostname,
|
||||||
ascii.Reset,
|
ascii.Reset,
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user