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"
|
2017-01-01 02:58:33 -05:00
|
|
|
#include "modules/cmdscript.hpp"
|
2016-12-05 14:41:00 -05:00
|
|
|
#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 02:58:33 -05:00
|
|
|
#include "modules/tailscript.hpp"
|
2016-12-05 14:41:00 -05:00
|
|
|
#include "modules/temperature.hpp"
|
|
|
|
#include "modules/text.hpp"
|
|
|
|
#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
|
|
|
|
#if ENABLE_ALSA
|
|
|
|
#include "modules/volume.hpp"
|
|
|
|
#endif
|
2016-12-19 16:01:37 -05:00
|
|
|
#if ENABLE_CURL
|
|
|
|
#include "modules/github.hpp"
|
|
|
|
#endif
|
2016-12-05 14:41:00 -05:00
|
|
|
#if WITH_XKB
|
|
|
|
#include "modules/xkeyboard.hpp"
|
|
|
|
#endif
|
2016-12-19 16:01:37 -05:00
|
|
|
#if not(ENABLE_I3 && ENABLE_MPD && ENABLE_NETWORK && ENABLE_ALSA && ENABLE_CURL && WITH_XKB)
|
2016-12-05 14:41:00 -05:00
|
|
|
#include "modules/unsupported.hpp"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
POLYBAR_NS
|
|
|
|
|
|
|
|
using namespace modules;
|
|
|
|
|
|
|
|
namespace {
|
2017-01-01 02:58:33 -05:00
|
|
|
module_interface* make_module(string&& name, const bar_settings& bar, string module_name) {
|
2016-12-05 14:41:00 -05:00
|
|
|
if (name == "internal/counter") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new counter_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/backlight") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new backlight_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/battery") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new battery_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/bspwm") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new bspwm_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/cpu") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new cpu_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/date") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new date_module(bar, move(module_name));
|
2016-12-19 16:01:37 -05:00
|
|
|
} else if (name == "internal/github") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new github_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/fs") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new fs_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/memory") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new memory_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/i3") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new i3_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/mpd") {
|
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") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new volume_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/network") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new network_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/temperature") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new temperature_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/xbacklight") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new xbacklight_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/xkeyboard") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new xkeyboard_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/xwindow") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new xwindow_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "internal/xworkspaces") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new xworkspaces_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "custom/text") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new text_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "custom/script") {
|
2017-01-01 02:58:33 -05:00
|
|
|
if (config::make().get<bool>("module/" + module_name, "tail", false)) {
|
|
|
|
return new tailscript_module(bar, move(module_name));
|
|
|
|
} else {
|
|
|
|
return new cmdscript_module(bar, move(module_name));
|
|
|
|
}
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "custom/menu") {
|
2017-01-01 02:58:33 -05:00
|
|
|
return new menu_module(bar, move(module_name));
|
2016-12-05 14:41:00 -05:00
|
|
|
} else if (name == "custom/ipc") {
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
POLYBAR_NS_END
|