taskbar: search user directories first for desktop files

This commit is contained in:
Bruce Mills 2024-04-01 14:30:31 -04:00
parent 3de9e0cbd3
commit 245043f9e7
1 changed files with 3 additions and 3 deletions

View File

@ -30,6 +30,9 @@ namespace waybar::modules::wlr {
static std::vector<std::string> search_prefix() {
std::vector<std::string> prefixes = {""};
std::string home_dir = std::getenv("HOME");
prefixes.push_back(home_dir + "/.local/share/");
auto xdg_data_dirs = std::getenv("XDG_DATA_DIRS");
if (!xdg_data_dirs) {
prefixes.emplace_back("/usr/share/");
@ -47,9 +50,6 @@ static std::vector<std::string> search_prefix() {
} while (end != std::string::npos);
}
std::string home_dir = std::getenv("HOME");
prefixes.push_back(home_dir + "/.local/share/");
for (auto &p : prefixes) spdlog::debug("Using 'desktop' search path prefix: {}", p);
return prefixes;