diff --git a/data/config b/data/config index 1c787a9..b50a844 100644 --- a/data/config +++ b/data/config @@ -12,6 +12,11 @@ # - foo\nbar -> "foobar" # - foo\sbar -> "foo bar" +# If true, gBar ignores *.scss files and only tries to load *.css files. +# This is useful, if you don't want to SCSS, or if you want to use newer SCSS features, +# that libsass (the backend gBar uses) doesn't support. +ForceCSS: false + # The following three options control the ordering of the widgets. # Reordering can cause slight margin inconsistencies, # so it is recommend to only make minor adjustments to the default layout. diff --git a/src/CSS.cpp b/src/CSS.cpp index bf052db..3f56218 100644 --- a/src/CSS.cpp +++ b/src/CSS.cpp @@ -112,14 +112,17 @@ namespace CSS for (auto& dir : locations) { - if (CompileAndLoadSCSS(dir + "/style.scss")) + if (!Config::Get().forceCSS) { - LOG("SCSS found and loaded successfully!"); - return; - } - else - { - LOG("Warning: Failed loading SCSS, falling back to CSS!"); + if (CompileAndLoadSCSS(dir + "/style.scss")) + { + LOG("SCSS found and loaded successfully!"); + return; + } + else + { + LOG("Warning: Failed loading SCSS, falling back to CSS!"); + } } if (LoadCSS(dir + "/style.css")) diff --git a/src/Config.cpp b/src/Config.cpp index a7ba0c3..9359e70 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -283,6 +283,7 @@ void Config::Load(const std::string& overrideConfigLocation) AddConfigVar("MicHighIcon", config.micHighIcon, lineView, foundProperty); AddConfigVar("PackageOutOfDateIcon", config.packageOutOfDateIcon, lineView, foundProperty); + AddConfigVar("ForceCSS", config.forceCSS, lineView, foundProperty); AddConfigVar("CenterWidgets", config.centerWidgets, lineView, foundProperty); AddConfigVar("AudioInput", config.audioInput, lineView, foundProperty); AddConfigVar("AudioRevealer", config.audioRevealer, lineView, foundProperty); diff --git a/src/Config.h b/src/Config.h index baa07b8..cb1e373 100644 --- a/src/Config.h +++ b/src/Config.h @@ -54,6 +54,7 @@ public: std::string checkPackagesCommand = "p=\"$(checkupdates)\"; e=$?; if [ $e -eq 127 ] ; then exit 127; fi; if [ $e -eq 2 ] ; then echo \"0\" && exit 0; fi; echo \"$p\" | wc -l"; + bool forceCSS = false; // Whether to disable loading SCSS directly. bool centerWidgets = true; // Force the center widgets to be in the center. bool audioRevealer = false; bool audioInput = false;