refactor(formatters): remove gpu information detection behavior based on os

This commit is contained in:
utox39
2025-07-11 14:21:37 +02:00
parent 7993cab4df
commit 5faf60e53d

View File

@@ -113,13 +113,9 @@ pub fn getDefaultFormattedGpuInfo(allocator: std.mem.Allocator) ![]u8 {
} }
pub fn getFormattedGpuInfo(allocator: std.mem.Allocator, key: []const u8, key_color: []const u8) ![]u8 { pub fn getFormattedGpuInfo(allocator: std.mem.Allocator, key: []const u8, key_color: []const u8) ![]u8 {
if (builtin.os.tag == .macos) { const gpu_info = try detection.hardware.getGpuInfo(allocator);
const gpu_info = try detection.hardware.getGpuInfo(allocator); defer allocator.free(gpu_info.gpu_name);
defer allocator.free(gpu_info.gpu_name); return try std.fmt.allocPrint(allocator, "{s}{s}:{s} {s} ({}) @ {d:.2} GHz", .{ key_color, key, ascii.Reset, gpu_info.gpu_name, gpu_info.gpu_cores, gpu_info.gpu_freq });
return try std.fmt.allocPrint(allocator, "{s}{s}:{s} {s} ({}) @ {d:.2} GHz", .{ key_color, key, ascii.Reset, gpu_info.gpu_name, gpu_info.gpu_cores, gpu_info.gpu_freq });
} else if (builtin.os.tag == .linux) {
return try std.fmt.allocPrint(allocator, "{s}{s}:{s} WIP", .{ key_color, key, ascii.Reset });
}
} }
pub fn getDefaultFormattedRamInfo(allocator: std.mem.Allocator) ![]u8 { pub fn getDefaultFormattedRamInfo(allocator: std.mem.Allocator) ![]u8 {