Skip to content

Commit

Permalink
Merge pull request #3102 from dep4/taskbar-directories
Browse files Browse the repository at this point in the history
taskbar: search user directories first for desktop files
  • Loading branch information
Alexays authored Apr 3, 2024
2 parents 3de9e0c + 245043f commit 42dc9cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/wlr/taskbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Check warning on line 33 in src/modules/wlr/taskbar.cpp

View workflow job for this annotation

GitHub Actions / build

src/modules/wlr/taskbar.cpp:33:15 [readability-identifier-naming]

invalid case style for variable 'home_dir'
prefixes.push_back(home_dir + "/.local/share/");

auto xdg_data_dirs = std::getenv("XDG_DATA_DIRS");

Check warning on line 36 in src/modules/wlr/taskbar.cpp

View workflow job for this annotation

GitHub Actions / build

src/modules/wlr/taskbar.cpp:36:3 [readability-qualified-auto]

'auto xdg_data_dirs' can be declared as 'auto *xdg_data_dirs'

Check warning on line 36 in src/modules/wlr/taskbar.cpp

View workflow job for this annotation

GitHub Actions / build

src/modules/wlr/taskbar.cpp:36:8 [readability-identifier-naming]

invalid case style for variable 'xdg_data_dirs'
if (!xdg_data_dirs) {
prefixes.emplace_back("/usr/share/");
Expand All @@ -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;
Expand Down

0 comments on commit 42dc9cb

Please sign in to comment.