nix-community / plasma-manager

Manage KDE Plasma with Home Manager
MIT License
537 stars 57 forks source link

[Feature]: Add option to control the data range of system monitor sensors #247

Closed Preons0 closed 6 days ago

Preons0 commented 1 week ago

It could be good if the system monitor widget had the ability to set a non-automatic range. Currently, I couldn't find the option if it does exist.

GraisenEdwards commented 1 week ago

Can you do

{
          systemMonitor = {
            title = "Upload Speed";
            displayStyle = "org.kde.ksysguard.piechart";
            sensors = [{
              name = "network/all/upload";
              label = "Upload Speed";
              color = "235,203,139";
            }];
          };
          config.foo.bar = "baz";
        }
}

Or just in general use one of the high level widgets and set low level options for them?

magnouvean commented 1 week ago

I don't think that will work since the setting will need to be in the specific widget category in plasma-org.kde.plasma.desktop-appletsrc. With that said it should be possible if you use something like:

{
  name = org.kde.plasma.systemmonitor;
  config = ...;
}

(here I haven't completed the configuration, but it is possible if you spend some time finding the correct values to put in config).

248 will add options for this though in the high-level widget, which is what I think is the best solution here. After that is merged you can specify range.from and range.to options for this widget. It will need some testing though as it's quite a large PR (it involves a lot of refactoring as well), so if anyone reading this has time to test it on their config and see if everything works (and comment how it does in the PR) that would be helpful :). It's pretty much done as well so probably will be in plasma-manager quite soon :)