Merge pull request #3102 from dep4/taskbar-directories

taskbar: search user directories first for desktop files
This commit is contained in:
Alexis Rouillard 2024-04-03 08:58:49 +02:00 committed by GitHub
commit 42dc9cb85f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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;