Skip to content

Commit

Permalink
CI fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexhuszagh committed Sep 7, 2024
1 parent b09a745 commit 762eda3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions example/breeze_theme.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,17 +423,18 @@ namespace breeze_stylesheets
// this will return something like `prefer - dark`, which is the true value.
// valid values are 'default', 'prefer-dark', 'prefer-light'.
const ::std::string command = "gsettings get org.gnome.desktop.interface ";
auto [stdout, code] = ::breeze_stylesheets::_run_command(command + "color-scheme");
if (code != EXIT_SUCCESS)
auto result = ::breeze_stylesheets::_run_command(command + "color-scheme");
if (::std::get<1>(result) != EXIT_SUCCESS)
{
// NOTE: We always assume this is due to invalid key, which might not be true
// since we don't check if gsettings exists first.
// if not found then trying older gtk-theme method
// this relies on the theme not lying to you : if the theme is dark, it ends in `- dark`.
auto [stdout, code] = ::breeze_stylesheets::_run_command(command + "gtk-theme");
result = ::breeze_stylesheets::_run_command(command + "gtk-theme");
}

if (code != EXIT_SUCCESS || !stdout.has_value())
auto stdout = ::std::get<0>(result);
if (::std::get<1>(result) != EXIT_SUCCESS || !stdout.has_value())
throw new ::std::runtime_error("Unable to get response for the current system theme.");

auto value = stdout.value();
Expand Down

0 comments on commit 762eda3

Please sign in to comment.