mirror of
https://github.com/polybar/polybar.git
synced 2025-04-07 17:32:38 -04:00
fix(plugin): Warn only for built plugins on a failed load.
This commit is contained in:
parent
e5f5fa59d2
commit
3f7b6c0e85
2 changed files with 25 additions and 5 deletions
|
@ -79,10 +79,12 @@ controller::controller(connection& conn, signal_emitter& emitter, const logger&
|
|||
|
||||
m_log.trace("controller: Load plugins");
|
||||
for (const auto name : plugin_names) {
|
||||
try {
|
||||
m_plugins.emplace_back(name);
|
||||
} catch (const application_error& err) {
|
||||
m_log.warn("Failed to load plugin '%s': %s", name, err.what());
|
||||
if (name) {
|
||||
try {
|
||||
m_plugins.emplace_back(name);
|
||||
} catch (const application_error& err) {
|
||||
m_log.warn("Failed to load plugin '%s': %s", name, err.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,20 +2,38 @@
|
|||
|
||||
#include "components/logger.hpp"
|
||||
#include "errors.hpp"
|
||||
#include "settings.hpp"
|
||||
#include "utils/plugin.hpp"
|
||||
|
||||
POLYBAR_NS
|
||||
|
||||
// clang-format off
|
||||
std::vector<const char*> plugin_names = {
|
||||
#if ENABLE_I3
|
||||
"libpolybar-utils-i3.so",
|
||||
#endif
|
||||
#if ENABLE_ALSA
|
||||
"libpolybar-modules-alsa.so",
|
||||
#endif
|
||||
#if ENABLE_CURL
|
||||
"libpolybar-modules-github.so",
|
||||
#endif
|
||||
#if ENABLE_I3
|
||||
"libpolybar-modules-i3.so",
|
||||
#endif
|
||||
#if ENABLE_MPD
|
||||
"libpolybar-modules-mpd.so",
|
||||
#endif
|
||||
#if ENABLE_NETWORK
|
||||
"libpolybar-modules-network.so",
|
||||
#endif
|
||||
#if ENABLE_PLUSEAUDIO
|
||||
"libpolybar-modules-pulseaudio.so",
|
||||
"libpolybar-modules-xkeyboard.so"
|
||||
#endif
|
||||
#if WITH_XKB
|
||||
"libpolybar-modules-xkeyboard.so",
|
||||
#endif
|
||||
nullptr
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue