2016-12-05 14:41:00 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common.hpp"
|
|
|
|
#include "modules/backlight.hpp"
|
|
|
|
#include "modules/battery.hpp"
|
|
|
|
#include "modules/bspwm.hpp"
|
|
|
|
#include "modules/counter.hpp"
|
|
|
|
#include "modules/cpu.hpp"
|
|
|
|
#include "modules/date.hpp"
|
|
|
|
#include "modules/fs.hpp"
|
|
|
|
#include "modules/ipc.hpp"
|
|
|
|
#include "modules/memory.hpp"
|
|
|
|
#include "modules/menu.hpp"
|
|
|
|
#include "modules/meta/base.hpp"
|
|
|
|
#include "modules/script.hpp"
|
2017-01-01 15:28:28 -05:00
|
|
|
#if DEBUG
|
|
|
|
#include "modules/systray.hpp"
|
|
|
|
#endif
|
2016-12-05 14:41:00 -05:00
|
|
|
#include "modules/temperature.hpp"
|
|
|
|
#include "modules/text.hpp"
|
2022-04-15 17:50:04 -04:00
|
|
|
#include "modules/tray.hpp"
|
2016-12-05 14:41:00 -05:00
|
|
|
#include "modules/xbacklight.hpp"
|
|
|
|
#include "modules/xwindow.hpp"
|
|
|
|
#include "modules/xworkspaces.hpp"
|
|
|
|
#if ENABLE_I3
|
|
|
|
#include "modules/i3.hpp"
|
|
|
|
#endif
|
|
|
|
#if ENABLE_MPD
|
|
|
|
#include "modules/mpd.hpp"
|
|
|
|
#endif
|
|
|
|
#if ENABLE_NETWORK
|
|
|
|
#include "modules/network.hpp"
|
|
|
|
#endif
|
2017-09-26 18:21:23 -04:00
|
|
|
#if ENABLE_ALSA
|
2018-01-20 15:50:48 -05:00
|
|
|
#include "modules/alsa.hpp"
|
2016-12-05 14:41:00 -05:00
|
|
|
#endif
|
2017-09-26 18:21:23 -04:00
|
|
|
#if ENABLE_PULSEAUDIO
|
|
|
|
#include "modules/pulseaudio.hpp"
|
|
|
|
#endif
|
2016-12-19 16:01:37 -05:00
|
|
|
#if ENABLE_CURL
|
|
|
|
#include "modules/github.hpp"
|
|
|
|
#endif
|
2017-01-12 21:52:56 -05:00
|
|
|
#if ENABLE_XKEYBOARD
|
2016-12-05 14:41:00 -05:00
|
|
|
#include "modules/xkeyboard.hpp"
|
|
|
|
#endif
|
|
|
|
#include "modules/unsupported.hpp"
|
|
|
|
|
|
|
|
POLYBAR_NS
|
|
|
|
|
|
|
|
using namespace modules;
|
|
|
|
|
|
|
|
namespace {
|
2018-01-20 16:58:19 -05:00
|
|
|
module_interface* make_module(string&& name, const bar_settings& bar, string module_name, const logger& m_log) {
|
2020-05-15 13:59:08 -04:00
|
|
|
if (name == counter_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new counter_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == backlight_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new backlight_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == battery_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new battery_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == bspwm_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new bspwm_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == cpu_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new cpu_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == date_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new date_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == github_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new github_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == fs_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new fs_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == memory_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new memory_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == i3_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new i3_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == mpd_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new mpd_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/volume") {
|
2020-05-15 14:45:38 -04:00
|
|
|
m_log.warn("internal/volume is deprecated, use %s instead", string(alsa_module::TYPE));
|
2018-02-10 17:03:21 -05:00
|
|
|
return new alsa_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == alsa_module::TYPE) {
|
2018-01-20 15:50:48 -05:00
|
|
|
return new alsa_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == pulseaudio_module::TYPE) {
|
2017-09-26 18:21:23 -04:00
|
|
|
return new pulseaudio_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == network_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new network_module(bar, move(module_name));
|
2017-01-01 15:28:28 -05:00
|
|
|
#if DEBUG
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == systray_module::TYPE) {
|
2017-01-01 15:28:28 -05:00
|
|
|
return new systray_module(bar, move(module_name));
|
|
|
|
#endif
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == temperature_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new temperature_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == xbacklight_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new xbacklight_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == xkeyboard_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new xkeyboard_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == xwindow_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new xwindow_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == xworkspaces_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new xworkspaces_module(bar, move(module_name));
|
2022-04-15 17:50:04 -04:00
|
|
|
} else if (name == tray_module::TYPE) {
|
|
|
|
return new tray_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == text_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new text_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == script_module::TYPE) {
|
2017-01-09 23:12:53 -05:00
|
|
|
return new script_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == menu_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new menu_module(bar, move(module_name));
|
2020-05-15 13:59:08 -04:00
|
|
|
} else if (name == ipc_module::TYPE) {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new ipc_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else {
|
|
|
|
throw application_error("Unknown module: " + name);
|
|
|
|
}
|
|
|
|
}
|
2020-05-15 13:59:08 -04:00
|
|
|
} // namespace
|
2016-12-05 14:41:00 -05:00
|
|
|
|
|
|
|
POLYBAR_NS_END
|