From b74b22bb6167e8dff083ec6988c98798bf8954d3 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 11 Apr 2025 13:50:24 -0500 Subject: [PATCH] waybar: add debug option --- modules/programs/waybar.nix | 48 ++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/modules/programs/waybar.nix b/modules/programs/waybar.nix index 357a68dbb..6fba062e4 100644 --- a/modules/programs/waybar.nix +++ b/modules/programs/waybar.nix @@ -218,31 +218,35 @@ in ''; }; - systemd.enable = mkEnableOption "Waybar systemd integration"; + systemd = { + enable = mkEnableOption "Waybar systemd integration"; - systemd.target = mkOption { - type = str; - default = config.wayland.systemd.target; - defaultText = literalExpression "config.wayland.systemd.target"; - example = "sway-session.target"; - description = '' - The systemd target that will automatically start the Waybar service. + enableDebug = mkEnableOption "debug logging"; - When setting this value to `"sway-session.target"`, - make sure to also enable {option}`wayland.windowManager.sway.systemd.enable`, - otherwise the service may never be started. - ''; - }; + enableInspect = mkOption { + type = bool; + default = false; + example = true; + description = '' + Inspect objects and find their CSS classes, experiment with live CSS styles, and lookup the current value of CSS properties. - systemd.enableInspect = mkOption { - type = bool; - default = false; - example = true; - description = '' - Inspect objects and find their CSS classes, experiment with live CSS styles, and lookup the current value of CSS properties. + See + ''; + }; - See - ''; + target = mkOption { + type = str; + default = config.wayland.systemd.target; + defaultText = literalExpression "config.wayland.systemd.target"; + example = "sway-session.target"; + description = '' + The systemd target that will automatically start the Waybar service. + + When setting this value to `"sway-session.target"`, + make sure to also enable {option}`wayland.windowManager.sway.systemd.enable`, + otherwise the service may never be started. + ''; + }; }; style = mkOption { @@ -357,7 +361,7 @@ in Service = { Environment = optional cfg.systemd.enableInspect "GTK_DEBUG=interactive"; ExecReload = "${pkgs.coreutils}/bin/kill -SIGUSR2 $MAINPID"; - ExecStart = "${cfg.package}/bin/waybar"; + ExecStart = "${cfg.package}/bin/waybar${lib.optionalString cfg.systemd.enableDebug " -l debug"}"; KillMode = "mixed"; Restart = "on-failure"; };