Open ragedogg opened 3 months ago
GPU and temperature readings can probably be implemented with LibreHardwareMonitorLib, and graphics can be implemented with Avalonia's own components I'll see if I can accomplish some of what you're asking.
using LibreHardwareMonitor.Hardware;
class Program
{
static void Main(string[] args)
{
Computer computer = new Computer();
computer.IsCpuEnabled = true;
computer.IsGpuEnabled = true;
computer.Open();
while (true)
{
computer.Accept(new UpdateVisitor());
foreach (IHardware hardware in computer.Hardware)
{
if (hardware.HardwareType == HardwareType.Cpu)
{
Console.WriteLine("CPU Temperature:");
foreach (ISensor sensor in hardware.Sensors)
{
if (sensor.SensorType == SensorType.Temperature)
{
Console.WriteLine("\t{0}: {1}°C", sensor.Name, sensor.Value);
}
}
}
else if (hardware.HardwareType == HardwareType.GpuNvidia || hardware.HardwareType == HardwareType.GpuAmd || hardware.HardwareType == HardwareType.GpuIntel)
{
Console.WriteLine("GPU Temperature:");
foreach (ISensor sensor in hardware.Sensors)
{
if (sensor.SensorType == SensorType.Temperature)
{
Console.WriteLine("\t{0}: {1}°C", sensor.Name, sensor.Value);
}
}
}
}
Thread.Sleep(1000);
}
}
}
class UpdateVisitor : IVisitor
{
public void VisitComputer(IComputer computer)
{
computer.Traverse(this);
}
public void VisitHardware(IHardware hardware)
{
hardware.Update();
foreach (IHardware subHardware in hardware.SubHardware)
subHardware.Accept(this);
}
public void VisitSensor(ISensor sensor) { }
public void VisitParameter(IParameter parameter) { }
}
It successfully reads out the temperature information, but has a hard time getting the average value.
GPU usage reading has not been successful yet.
There are also multiple GPUs and multiple temperature sensors to consider later, even if some devices don't have temperature sensors.
Other things such as color changes and graphics, I am not familiar with some of the logic of this project and may need to be implemented by other contributors or project owners
Hi! You provided a lot of useful suggestions Let's discuss it one by one:
Font selector is already available with 0.5.0 release, but there are only Inter
and Segoe UI
fonts available.
What font do you want to use? Is it native or a custom one?
Background color for now can be only light or dark I plan to add a feature for Windows theme, allowing to use Accent color as background color. (Like Windows 8 colored tiles with white text)
Do you think this will meet your needs? I surely can add customisations for each individual widget, but it would take more time and I really not sure how to show it in the UI.
As for the Monitor widget:
Graphs will be added later. The Monitor widget itself is not fully ready yet. I want to implement different size support first and add more metrics for it.
Temperature (CPU, GPU) metric Thanks @WhatDamon for the temperature sensors code example. I will check it and use it for Monitor widget.
GPU metric I was researching about getting GPU usage metrics. For now, I only know that different graphics card brands provide different APIs to retrieve the data. I didn't succeeded in searching for a common way, that would work with all graphic cards. I will continue my search. Also, contribution would be helpful here
Hi, Do you plan to create font, background etc color for manual change? This would be great :)
and another suggestion... for the Monitor widget, option to add graph, temp and GPU to monitor :)
i know. a lot of suggestions :)