diff --git a/source/detail/posix/theme.cpp b/source/detail/posix/theme.cpp index cebcf8f5..2eec4797 100644 --- a/source/detail/posix/theme.cpp +++ b/source/detail/posix/theme.cpp @@ -85,9 +85,9 @@ namespace nana return values; } + namespace fs = std::filesystem; std::string find_gnome_theme_name() { - namespace fs = std::filesystem; try { //Searches all the gschema override files @@ -156,6 +156,41 @@ namespace nana } + std::string find_kde_theme_name() + { + auto home = getenv("HOME"); + if(home) + { + fs::path kdeglobals{home}; + kdeglobals /= ".kde/share/config/kdeglobals"; + + std::error_code err; + if(fs::exists(kdeglobals, err)) + { + std::ifstream ifs{kdeglobals}; + return find_value(ifs, "Icons", "Theme"); + } + } + return {}; + } + + std::string find_theme_name() + { + auto name = find_kde_theme_name(); + + if(name.empty()) + { + name = find_gnome_theme_name(); + std::cout<<"GNOME:"<