From 9a4937c3b80a48fa404da1fa43a47acb1d7b0ae1 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Tue, 4 Jul 2023 18:49:40 +0200 Subject: [PATCH] Added dev arg for ignoring packaged CSS Good for development where the packaged CSS file (/etc/...) would still be used --- src/functions.vala | 14 ++++++++------ src/main.vala | 13 +++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/functions.vala b/src/functions.vala index 117865a..06f3af5 100644 --- a/src/functions.vala +++ b/src/functions.vala @@ -57,12 +57,14 @@ namespace SwayNotificationCenter { int css_priority = ConfigModel.instance.cssPriority.get_priority (); // Load packaged CSS as backup - string system_css = get_style_path (null, true); - system_css_provider.load_from_path (system_css); - Gtk.StyleContext.add_provider_for_display ( - Gdk.Display.get_default (), - system_css_provider, - css_priority); + if (!no_base_css) { + string system_css = get_style_path (null, true); + system_css_provider.load_from_path (system_css); + Gtk.StyleContext.add_provider_for_display ( + Gdk.Display.get_default (), + system_css_provider, + css_priority); + } // Load user CSS string user_css = get_style_path (style_path); diff --git a/src/main.vala b/src/main.vala index a2119c4..2af8717 100644 --- a/src/main.vala +++ b/src/main.vala @@ -1,7 +1,10 @@ namespace SwayNotificationCenter { static SwayncDaemon swaync_daemon; + // Args static string ? style_path; static string ? config_path; + // Dev args + static bool no_base_css = false; static uint layer_shell_protocol_version = 3; @@ -16,6 +19,16 @@ namespace SwayNotificationCenter { case "--style": style_path = args[++i]; break; + case "-D": + string dev_arg = args[++i]; + switch (dev_arg) { + case "no-base-css": + no_base_css = true; + break; + default: + break; + } + break; case "-c": case "--config": config_path = args[++i];