Added dev arg for ignoring packaged CSS

Good for development where the packaged CSS file (/etc/...) would still be used
This commit is contained in:
Erik Reider 2023-07-04 18:49:40 +02:00
parent dfaed0eeb2
commit 9a4937c3b8
2 changed files with 21 additions and 6 deletions

View File

@ -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);

View File

@ -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];