nwg-panel: integrate optional sysload executor (WIP; disabled by default)

This commit is contained in:
2024-06-19 01:01:03 +00:00
parent 64b169069a
commit e4e32f46fe
2 changed files with 25 additions and 6 deletions

View File

@@ -6,9 +6,10 @@
# - add CPU/meminfo executor
# - use sane-sysinfo
{
components,
controlsSettingsComponents,
height,
locker,
modulesRight,
playerctlChars,
windowIcon,
windowTitle,
@@ -50,9 +51,7 @@
modules-center = [
"clock"
];
modules-right = [
"playerctl"
];
modules-right = modulesRight;
clock = {
angle = 0.0;
@@ -80,7 +79,7 @@
battery-low-interval = 4; #< notify every N minutes when battery continues to remain low
battery-low-level = 15; #< notify if battery is lower than this percent
# commands.battery = ""; #< optional action to perform when battery icon is clicked in the drop-down menu
components = components;
components = controlsSettingsComponents;
click-closes = false;
custom-items = [];
css-name = "controls-window";
@@ -143,6 +142,20 @@
show-name = windowTitle;
};
executor-sysload = {
script = "sane-sysinfo";
interval = 10;
css-name = "";
on-right-click = "";
icon-size = 16;
show-icon = false;
tooltip-text = "";
on-left-click = "";
on-middle-click = "";
on-scroll-up = "";
on-scroll-down = "";
};
# unused modules:
brightness-slider = {};
dwl-tags = {};

View File

@@ -48,6 +48,7 @@ in
brightness = mkEnableOption' true "display backlight level and slider";
mediaTitle = mkEnableOption' true "display title of current song/media";
mediaPrevNext = mkEnableOption' true "display prev/next button in media";
sysload = mkEnableOption' false "display system load info (cpu/memory)";
windowIcon = mkEnableOption' true "display icon of active window";
windowTitle = mkEnableOption' true "display title of active window";
workspaceNumbers = mkOption {
@@ -115,7 +116,7 @@ in
inherit (cfg.config) locker height windowIcon windowTitle workspaceHideEmpty workspaceNumbers;
# component order matters, mostly for the drop-down.
# default for most tools (e.g. swaync) is brightness control above volume.
components =
controlsSettingsComponents =
lib.optionals cfg.config.brightness [
"brightness"
] ++ [
@@ -125,6 +126,11 @@ in
"battery"
]
;
modulesRight = [
"playerctl"
] ++ lib.optionals cfg.config.sysload [
"executor-sysload"
];
playerctlChars = if cfg.config.mediaTitle then 60 else 0;
});