diff --git a/include/factory.hpp b/include/factory.hpp index a337335b..a5515b8f 100644 --- a/include/factory.hpp +++ b/include/factory.hpp @@ -14,7 +14,7 @@ #include "modules/idle_inhibitor.hpp" #include "modules/memory.hpp" #include "modules/disk.hpp" -#if defined(HAVE_DBUSMENU) && !defined(NO_FILESYSTEM) +#ifdef HAVE_DBUSMENU #include "modules/sni/tray.hpp" #endif #ifdef HAVE_LIBNL diff --git a/include/modules/sni/item.hpp b/include/modules/sni/item.hpp index fc04673e..3cbd0b74 100644 --- a/include/modules/sni/item.hpp +++ b/include/modules/sni/item.hpp @@ -10,11 +10,6 @@ #include #include #include -#ifdef FILESYSTEM_EXPERIMENTAL -#include -#else -#include -#endif namespace waybar::modules::SNI { diff --git a/src/factory.cpp b/src/factory.cpp index 73c9f9f7..263071b5 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -38,7 +38,7 @@ waybar::AModule* waybar::Factory::makeModule(const std::string& name) const { if (ref == "disk") { return new waybar::modules::Disk(id, config_[name]); } -#if defined(HAVE_DBUSMENU) && !defined(NO_FILESYSTEM) +#ifdef HAVE_DBUSMENU if (ref == "tray") { return new waybar::modules::SNI::Tray(id, bar_, config_[name]); } diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp index b298e442..abf95560 100644 --- a/src/modules/sni/item.cpp +++ b/src/modules/sni/item.cpp @@ -1,6 +1,7 @@ #include "modules/sni/item.hpp" #include #include +#include template <> struct fmt::formatter : formatter { @@ -256,11 +257,8 @@ void Item::updateImage() { if (!icon_name.empty()) { try { // Try to find icons specified by path and filename -#ifdef FILESYSTEM_EXPERIMENTAL - if (std::experimental::filesystem::exists(icon_name)) { -#else - if (std::filesystem::exists(icon_name)) { -#endif + std::ifstream temp(icon_name); + if (temp.is_open()) { auto pixbuf = Gdk::Pixbuf::create_from_file(icon_name); if (pixbuf->gobj() != nullptr) { // An icon specified by path and filename may be the wrong size for