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 # - add CPU/meminfo executor
# - use sane-sysinfo # - use sane-sysinfo
{ {
components, controlsSettingsComponents,
height, height,
locker, locker,
modulesRight,
playerctlChars, playerctlChars,
windowIcon, windowIcon,
windowTitle, windowTitle,
@@ -50,9 +51,7 @@
modules-center = [ modules-center = [
"clock" "clock"
]; ];
modules-right = [ modules-right = modulesRight;
"playerctl"
];
clock = { clock = {
angle = 0.0; angle = 0.0;
@@ -80,7 +79,7 @@
battery-low-interval = 4; #< notify every N minutes when battery continues to remain low 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 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 # commands.battery = ""; #< optional action to perform when battery icon is clicked in the drop-down menu
components = components; components = controlsSettingsComponents;
click-closes = false; click-closes = false;
custom-items = []; custom-items = [];
css-name = "controls-window"; css-name = "controls-window";
@@ -143,6 +142,20 @@
show-name = windowTitle; 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: # unused modules:
brightness-slider = {}; brightness-slider = {};
dwl-tags = {}; dwl-tags = {};

View File

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