From 75b784d04c9482055f3c11c438c2be29d0a86c70 Mon Sep 17 00:00:00 2001 From: Dillon Lees Date: Sun, 7 Dec 2025 21:32:02 -0500 Subject: [PATCH 1/2] chore: ignore nix build output directory --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 65c129fa..a924327b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ CMakeUserPresets.json #cmake-build-* build/ +result .vscode/ .cache/ @@ -26,4 +27,4 @@ protocols/*.cpp protocols/*.hpp *.inc -src/renderer/gl/shaders/Shaders.hpp \ No newline at end of file +src/renderer/gl/shaders/Shaders.hpp From 593734ec3bd53346b122d72cd7cfa69aa2912a11 Mon Sep 17 00:00:00 2001 From: Dillon Lees Date: Sun, 7 Dec 2025 22:27:52 -0500 Subject: [PATCH 2/2] feat(icons): search for icon themes in $xdg_data_dirs, $xdg_data_home, and the non-xdg compliant ~/.icons directories --- src/system/Icons.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/system/Icons.cpp b/src/system/Icons.cpp index 0129c035..5c4ebf8d 100644 --- a/src/system/Icons.cpp +++ b/src/system/Icons.cpp @@ -7,6 +7,8 @@ #include #include +#include + #include #include #include @@ -32,9 +34,30 @@ static std::optional readFileAsString(const std::string& path) { return trim(std::string((std::istreambuf_iterator(file)), (std::istreambuf_iterator()))); } -static const std::array ICON_THEME_DIRS = {"/usr/share/icons", "/usr/local/share/icons", "~/.icons"}; +static std::vector getIconSearchPaths() { + std::vector paths; + + // user icons (e.g., ~/.local/share/icons) + const gchar* userDataDir = g_get_user_data_dir(); + if (userDataDir) { + paths.push_back(std::string(userDataDir) + "/icons"); + } + + // system icons (e.g. /usr/local/share/icons, /usr/share/icons) + const gchar* const* systemDataDirs = g_get_system_data_dirs(); + for (int i = 0; systemDataDirs[i] != nullptr; i++) { + paths.push_back(std::string(systemDataDirs[i]) + "/icons"); + } + + //non-xdg compliant icon dirs + paths.push_back("~/.icons"); + + return paths; +} + +static const auto ICON_THEME_DIRS = getIconSearchPaths(); -static std::string fromDir(const char* p) { +static std::string fromDir(const std::string& p) { static auto HOME_ENV = getenv("HOME"); if (p[0] == '~') { @@ -201,4 +224,4 @@ SP CSystemIconFactory::lookupIcon(const std::string& ico return makeShared(); return makeShared(iconName); -} \ No newline at end of file +}