Remove unsupported.hpp (#2956)
* Remove unsupported.hpp * Rename names.hpp to types.hpp * Replace macro by function * Add missing cassert include in controller.cpp
This commit is contained in:
parent
031a29332a
commit
f5169abde2
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "modules/meta/event_module.hpp"
|
#include "modules/meta/event_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "settings.hpp"
|
#include "settings.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
@ -29,7 +30,7 @@ namespace modules {
|
|||||||
string get_output();
|
string get_output();
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/alsa";
|
static constexpr auto TYPE = ALSA_TYPE;
|
||||||
|
|
||||||
static constexpr auto EVENT_INC = "inc";
|
static constexpr auto EVENT_INC = "inc";
|
||||||
static constexpr auto EVENT_DEC = "dec";
|
static constexpr auto EVENT_DEC = "dec";
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "components/config.hpp"
|
#include "components/config.hpp"
|
||||||
#include "modules/meta/inotify_module.hpp"
|
#include "modules/meta/inotify_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "settings.hpp"
|
#include "settings.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
@ -26,7 +27,7 @@ namespace modules {
|
|||||||
bool on_event(const inotify_event& event);
|
bool on_event(const inotify_event& event);
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/backlight";
|
static constexpr auto TYPE = BACKLIGHT_TYPE;
|
||||||
|
|
||||||
static constexpr const char* EVENT_INC = "inc";
|
static constexpr const char* EVENT_INC = "inc";
|
||||||
static constexpr const char* EVENT_DEC = "dec";
|
static constexpr const char* EVENT_DEC = "dec";
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
#include "modules/meta/inotify_module.hpp"
|
#include "modules/meta/inotify_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
|
|
||||||
@ -55,7 +56,7 @@ namespace modules {
|
|||||||
string get_format() const;
|
string get_format() const;
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/battery";
|
static constexpr auto TYPE = BATTERY_TYPE;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
state current_state();
|
state current_state();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "modules/meta/event_module.hpp"
|
#include "modules/meta/event_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "utils/bspwm.hpp"
|
#include "utils/bspwm.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
@ -47,7 +48,7 @@ namespace modules {
|
|||||||
string get_output();
|
string get_output();
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/bspwm";
|
static constexpr auto TYPE = BSPWM_TYPE;
|
||||||
|
|
||||||
static constexpr auto EVENT_FOCUS = "focus";
|
static constexpr auto EVENT_FOCUS = "focus";
|
||||||
static constexpr auto EVENT_NEXT = "next";
|
static constexpr auto EVENT_NEXT = "next";
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "modules/meta/timer_module.hpp"
|
#include "modules/meta/timer_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
|
|
||||||
@ -12,7 +13,7 @@ namespace modules {
|
|||||||
bool update();
|
bool update();
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/counter";
|
static constexpr auto TYPE = COUNTER_TYPE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr auto TAG_COUNTER = "<counter>";
|
static constexpr auto TAG_COUNTER = "<counter>";
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "modules/meta/timer_module.hpp"
|
#include "modules/meta/timer_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "settings.hpp"
|
#include "settings.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
@ -26,7 +27,7 @@ namespace modules {
|
|||||||
string get_format() const;
|
string get_format() const;
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/cpu";
|
static constexpr auto TYPE = CPU_TYPE;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool read_values();
|
bool read_values();
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "modules/meta/timer_module.hpp"
|
#include "modules/meta/timer_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
|
|
||||||
@ -17,7 +18,7 @@ namespace modules {
|
|||||||
bool update();
|
bool update();
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/date";
|
static constexpr auto TYPE = DATE_TYPE;
|
||||||
|
|
||||||
static constexpr auto EVENT_TOGGLE = "toggle";
|
static constexpr auto EVENT_TOGGLE = "toggle";
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "components/config.hpp"
|
#include "components/config.hpp"
|
||||||
#include "modules/meta/timer_module.hpp"
|
#include "modules/meta/timer_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "settings.hpp"
|
#include "settings.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
@ -42,7 +43,7 @@ namespace modules {
|
|||||||
string get_output();
|
string get_output();
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/fs";
|
static constexpr auto TYPE = FS_TYPE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr auto FORMAT_MOUNTED = "format-mounted";
|
static constexpr auto FORMAT_MOUNTED = "format-mounted";
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
||||||
#include "modules/meta/timer_module.hpp"
|
#include "modules/meta/timer_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "settings.hpp"
|
#include "settings.hpp"
|
||||||
#include "utils/http.hpp"
|
#include "utils/http.hpp"
|
||||||
|
|
||||||
@ -20,7 +21,7 @@ namespace modules {
|
|||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
string get_format() const;
|
string get_format() const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/github";
|
static constexpr auto TYPE = GITHUB_TYPE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void update_label(int);
|
void update_label(int);
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "components/config.hpp"
|
#include "components/config.hpp"
|
||||||
#include "modules/meta/event_module.hpp"
|
#include "modules/meta/event_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "utils/i3.hpp"
|
#include "utils/i3.hpp"
|
||||||
#include "utils/io.hpp"
|
#include "utils/io.hpp"
|
||||||
|
|
||||||
@ -51,7 +52,7 @@ namespace modules {
|
|||||||
bool update();
|
bool update();
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/i3";
|
static constexpr auto TYPE = I3_TYPE;
|
||||||
|
|
||||||
static constexpr auto EVENT_FOCUS = "focus";
|
static constexpr auto EVENT_FOCUS = "focus";
|
||||||
static constexpr auto EVENT_NEXT = "next";
|
static constexpr auto EVENT_NEXT = "next";
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "modules/meta/static_module.hpp"
|
#include "modules/meta/static_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "utils/command.hpp"
|
#include "utils/command.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
@ -33,7 +34,7 @@ namespace modules {
|
|||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
void on_message(const string& message);
|
void on_message(const string& message);
|
||||||
|
|
||||||
static constexpr auto TYPE = "custom/ipc";
|
static constexpr auto TYPE = IPC_TYPE;
|
||||||
|
|
||||||
static constexpr auto EVENT_SEND = "send";
|
static constexpr auto EVENT_SEND = "send";
|
||||||
static constexpr auto EVENT_HOOK = "hook";
|
static constexpr auto EVENT_HOOK = "hook";
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "modules/meta/timer_module.hpp"
|
#include "modules/meta/timer_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "settings.hpp"
|
#include "settings.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
@ -16,7 +17,7 @@ namespace modules {
|
|||||||
string get_format() const;
|
string get_format() const;
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/memory";
|
static constexpr auto TYPE = MEMORY_TYPE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr const char* TAG_LABEL{"<label>"};
|
static constexpr const char* TAG_LABEL{"<label>"};
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "modules/meta/static_module.hpp"
|
#include "modules/meta/static_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
|
|
||||||
@ -22,7 +23,7 @@ namespace modules {
|
|||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
void update() {}
|
void update() {}
|
||||||
|
|
||||||
static constexpr auto TYPE = "custom/menu";
|
static constexpr auto TYPE = MENU_TYPE;
|
||||||
|
|
||||||
static constexpr auto EVENT_OPEN = "open";
|
static constexpr auto EVENT_OPEN = "open";
|
||||||
static constexpr auto EVENT_CLOSE = "close";
|
static constexpr auto EVENT_CLOSE = "close";
|
||||||
|
@ -43,4 +43,3 @@
|
|||||||
#if ENABLE_XKEYBOARD
|
#if ENABLE_XKEYBOARD
|
||||||
#include "modules/xkeyboard.hpp"
|
#include "modules/xkeyboard.hpp"
|
||||||
#endif
|
#endif
|
||||||
#include "modules/unsupported.hpp"
|
|
||||||
|
37
include/modules/meta/types.hpp
Normal file
37
include/modules/meta/types.hpp
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "common.hpp"
|
||||||
|
|
||||||
|
POLYBAR_NS
|
||||||
|
|
||||||
|
namespace modules {
|
||||||
|
|
||||||
|
static constexpr const char ALSA_TYPE[] = "internal/alsa";
|
||||||
|
static constexpr const char BACKLIGHT_TYPE[] = "internal/backlight";
|
||||||
|
static constexpr const char BATTERY_TYPE[] = "internal/battery";
|
||||||
|
static constexpr const char BSPWM_TYPE[] = "internal/bspwm";
|
||||||
|
static constexpr const char COUNTER_TYPE[] = "internal/counter";
|
||||||
|
static constexpr const char CPU_TYPE[] = "internal/cpu";
|
||||||
|
static constexpr const char DATE_TYPE[] = "internal/date";
|
||||||
|
static constexpr const char FS_TYPE[] = "internal/fs";
|
||||||
|
static constexpr const char GITHUB_TYPE[] = "internal/github";
|
||||||
|
static constexpr const char I3_TYPE[] = "internal/i3";
|
||||||
|
static constexpr const char MEMORY_TYPE[] = "internal/memory";
|
||||||
|
static constexpr const char MPD_TYPE[] = "internal/mpd";
|
||||||
|
static constexpr const char NETWORK_TYPE[] = "internal/network";
|
||||||
|
static constexpr const char PULSEAUDIO_TYPE[] = "internal/pulseaudio";
|
||||||
|
static constexpr const char TEMPERATURE_TYPE[] = "internal/temperature";
|
||||||
|
static constexpr const char TRAY_TYPE[] = "internal/tray";
|
||||||
|
static constexpr const char XBACKLIGHT_TYPE[] = "internal/xbacklight";
|
||||||
|
static constexpr const char XKEYBOARD_TYPE[] = "internal/xkeyboard";
|
||||||
|
static constexpr const char XWINDOW_TYPE[] = "internal/xwindow";
|
||||||
|
static constexpr const char XWORKSPACES_TYPE[] = "internal/xworkspaces";
|
||||||
|
|
||||||
|
static constexpr const char IPC_TYPE[] = "custom/ipc";
|
||||||
|
static constexpr const char MENU_TYPE[] = "custom/menu";
|
||||||
|
static constexpr const char SCRIPT_TYPE[] = "custom/script";
|
||||||
|
static constexpr const char TEXT_TYPE[] = "custom/text";
|
||||||
|
|
||||||
|
} // namespace modules
|
||||||
|
|
||||||
|
POLYBAR_NS_END
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "adapters/mpd.hpp"
|
#include "adapters/mpd.hpp"
|
||||||
#include "modules/meta/event_module.hpp"
|
#include "modules/meta/event_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "utils/env.hpp"
|
#include "utils/env.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
@ -24,7 +25,7 @@ namespace modules {
|
|||||||
string get_output();
|
string get_output();
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/mpd";
|
static constexpr auto TYPE = MPD_TYPE;
|
||||||
|
|
||||||
static constexpr const char* EVENT_PLAY = "play";
|
static constexpr const char* EVENT_PLAY = "play";
|
||||||
static constexpr const char* EVENT_PAUSE = "pause";
|
static constexpr const char* EVENT_PAUSE = "pause";
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "adapters/net.hpp"
|
#include "adapters/net.hpp"
|
||||||
#include "components/config.hpp"
|
#include "components/config.hpp"
|
||||||
#include "modules/meta/timer_module.hpp"
|
#include "modules/meta/timer_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
|
|
||||||
@ -18,7 +19,7 @@ namespace modules {
|
|||||||
string get_format() const;
|
string get_format() const;
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/network";
|
static constexpr auto TYPE = NETWORK_TYPE;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void subthread_routine();
|
void subthread_routine();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "modules/meta/event_module.hpp"
|
#include "modules/meta/event_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "settings.hpp"
|
#include "settings.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
@ -22,7 +23,7 @@ namespace modules {
|
|||||||
string get_output();
|
string get_output();
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/pulseaudio";
|
static constexpr auto TYPE = PULSEAUDIO_TYPE;
|
||||||
|
|
||||||
static constexpr auto EVENT_INC = "inc";
|
static constexpr auto EVENT_INC = "inc";
|
||||||
static constexpr auto EVENT_DEC = "dec";
|
static constexpr auto EVENT_DEC = "dec";
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "adapters/script_runner.hpp"
|
#include "adapters/script_runner.hpp"
|
||||||
#include "modules/meta/base.hpp"
|
#include "modules/meta/base.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "utils/command.hpp"
|
#include "utils/command.hpp"
|
||||||
#include "utils/io.hpp"
|
#include "utils/io.hpp"
|
||||||
|
|
||||||
@ -20,7 +21,7 @@ namespace modules {
|
|||||||
|
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "custom/script";
|
static constexpr auto TYPE = SCRIPT_TYPE;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool check_condition();
|
bool check_condition();
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include <istream>
|
#include <istream>
|
||||||
|
|
||||||
#include "modules/meta/timer_module.hpp"
|
#include "modules/meta/timer_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "settings.hpp"
|
#include "settings.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
@ -18,7 +19,7 @@ namespace modules {
|
|||||||
string get_format() const;
|
string get_format() const;
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/temperature";
|
static constexpr auto TYPE = TEMPERATURE_TYPE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr auto TAG_LABEL = "<label>";
|
static constexpr auto TAG_LABEL = "<label>";
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "modules/meta/static_module.hpp"
|
#include "modules/meta/static_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
|
|
||||||
@ -14,7 +15,7 @@ namespace modules {
|
|||||||
string get_output();
|
string get_output();
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "custom/text";
|
static constexpr auto TYPE = TEXT_TYPE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr const char* TAG_LABEL{"<label>"};
|
static constexpr const char* TAG_LABEL{"<label>"};
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
#include "components/bar.hpp"
|
#include "components/bar.hpp"
|
||||||
#include "modules/meta/static_module.hpp"
|
#include "modules/meta/static_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "x11/tray_manager.hpp"
|
#include "x11/tray_manager.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
@ -17,7 +18,7 @@ class tray_module : public static_module<tray_module> {
|
|||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
void update() {}
|
void update() {}
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/tray";
|
static constexpr auto TYPE = TRAY_TYPE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr const char* TAG_TRAY{"<tray>"};
|
static constexpr const char* TAG_TRAY{"<tray>"};
|
||||||
|
@ -1,68 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "modules/meta/base.hpp"
|
|
||||||
#include "modules/meta/base.inl"
|
|
||||||
|
|
||||||
POLYBAR_NS
|
|
||||||
|
|
||||||
namespace modules {
|
|
||||||
struct module_interface;
|
|
||||||
|
|
||||||
#define DEFINE_UNSUPPORTED_MODULE(MODULE_NAME, MODULE_TYPE) \
|
|
||||||
class MODULE_NAME : public module_interface { \
|
|
||||||
public: \
|
|
||||||
MODULE_NAME(const bar_settings, string, const config&) { \
|
|
||||||
throw application_error("No built-in support for '" + string{MODULE_TYPE} + "'"); \
|
|
||||||
} \
|
|
||||||
static constexpr auto TYPE = MODULE_TYPE; \
|
|
||||||
string type() const override { \
|
|
||||||
return ""; \
|
|
||||||
} \
|
|
||||||
string name_raw() const override { \
|
|
||||||
return ""; \
|
|
||||||
} \
|
|
||||||
string name() const override { \
|
|
||||||
return ""; \
|
|
||||||
} \
|
|
||||||
bool running() const override { \
|
|
||||||
return false; \
|
|
||||||
} \
|
|
||||||
bool visible() const override { \
|
|
||||||
return false; \
|
|
||||||
} \
|
|
||||||
void start() override {} \
|
|
||||||
void stop() override {} \
|
|
||||||
void join() override {} \
|
|
||||||
void halt(string) override {} \
|
|
||||||
string contents() override { \
|
|
||||||
return ""; \
|
|
||||||
} \
|
|
||||||
bool input(const string&, const string&) override { \
|
|
||||||
return false; \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#if not ENABLE_I3
|
|
||||||
DEFINE_UNSUPPORTED_MODULE(i3_module, "internal/i3");
|
|
||||||
#endif
|
|
||||||
#if not ENABLE_MPD
|
|
||||||
DEFINE_UNSUPPORTED_MODULE(mpd_module, "internal/mpd");
|
|
||||||
#endif
|
|
||||||
#if not ENABLE_NETWORK
|
|
||||||
DEFINE_UNSUPPORTED_MODULE(network_module, "internal/network");
|
|
||||||
#endif
|
|
||||||
#if not ENABLE_ALSA
|
|
||||||
DEFINE_UNSUPPORTED_MODULE(alsa_module, "internal/alsa");
|
|
||||||
#endif
|
|
||||||
#if not ENABLE_PULSEAUDIO
|
|
||||||
DEFINE_UNSUPPORTED_MODULE(pulseaudio_module, "internal/pulseaudio");
|
|
||||||
#endif
|
|
||||||
#if not ENABLE_CURL
|
|
||||||
DEFINE_UNSUPPORTED_MODULE(github_module, "internal/github");
|
|
||||||
#endif
|
|
||||||
#if not ENABLE_XKEYBOARD
|
|
||||||
DEFINE_UNSUPPORTED_MODULE(xkeyboard_module, "internal/xkeyboard");
|
|
||||||
#endif
|
|
||||||
} // namespace modules
|
|
||||||
|
|
||||||
POLYBAR_NS_END
|
|
@ -3,6 +3,7 @@
|
|||||||
#include "components/config.hpp"
|
#include "components/config.hpp"
|
||||||
#include "modules/meta/event_handler.hpp"
|
#include "modules/meta/event_handler.hpp"
|
||||||
#include "modules/meta/static_module.hpp"
|
#include "modules/meta/static_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "settings.hpp"
|
#include "settings.hpp"
|
||||||
#include "x11/extensions/randr.hpp"
|
#include "x11/extensions/randr.hpp"
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ namespace modules {
|
|||||||
string get_output();
|
string get_output();
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/xbacklight";
|
static constexpr auto TYPE = XBACKLIGHT_TYPE;
|
||||||
|
|
||||||
static constexpr const char* EVENT_INC = "inc";
|
static constexpr const char* EVENT_INC = "inc";
|
||||||
static constexpr const char* EVENT_DEC = "dec";
|
static constexpr const char* EVENT_DEC = "dec";
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include "drawtypes/layouticonset.hpp"
|
#include "drawtypes/layouticonset.hpp"
|
||||||
#include "modules/meta/event_handler.hpp"
|
#include "modules/meta/event_handler.hpp"
|
||||||
#include "modules/meta/static_module.hpp"
|
#include "modules/meta/static_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "x11/extensions/xkb.hpp"
|
#include "x11/extensions/xkb.hpp"
|
||||||
#include "x11/window.hpp"
|
#include "x11/window.hpp"
|
||||||
|
|
||||||
@ -27,7 +28,7 @@ namespace modules {
|
|||||||
void update();
|
void update();
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/xkeyboard";
|
static constexpr auto TYPE = XKEYBOARD_TYPE;
|
||||||
|
|
||||||
static constexpr const char* EVENT_SWITCH = "switch";
|
static constexpr const char* EVENT_SWITCH = "switch";
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "modules/meta/event_handler.hpp"
|
#include "modules/meta/event_handler.hpp"
|
||||||
#include "modules/meta/static_module.hpp"
|
#include "modules/meta/static_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "x11/ewmh.hpp"
|
#include "x11/ewmh.hpp"
|
||||||
#include "x11/icccm.hpp"
|
#include "x11/icccm.hpp"
|
||||||
#include "x11/window.hpp"
|
#include "x11/window.hpp"
|
||||||
@ -38,7 +39,7 @@ namespace modules {
|
|||||||
void update();
|
void update();
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/xwindow";
|
static constexpr auto TYPE = XWINDOW_TYPE;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void handle(const evt::property_notify& evt) override;
|
void handle(const evt::property_notify& evt) override;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "modules/meta/event_handler.hpp"
|
#include "modules/meta/event_handler.hpp"
|
||||||
#include "modules/meta/static_module.hpp"
|
#include "modules/meta/static_module.hpp"
|
||||||
|
#include "modules/meta/types.hpp"
|
||||||
#include "x11/ewmh.hpp"
|
#include "x11/ewmh.hpp"
|
||||||
|
|
||||||
POLYBAR_NS
|
POLYBAR_NS
|
||||||
@ -50,7 +51,7 @@ namespace modules {
|
|||||||
string get_output();
|
string get_output();
|
||||||
bool build(builder* builder, const string& tag) const;
|
bool build(builder* builder, const string& tag) const;
|
||||||
|
|
||||||
static constexpr auto TYPE = "internal/xworkspaces";
|
static constexpr auto TYPE = XWORKSPACES_TYPE;
|
||||||
|
|
||||||
static constexpr auto EVENT_FOCUS = "focus";
|
static constexpr auto EVENT_FOCUS = "focus";
|
||||||
static constexpr auto EVENT_NEXT = "next";
|
static constexpr auto EVENT_NEXT = "next";
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "components/controller.hpp"
|
#include "components/controller.hpp"
|
||||||
|
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
#include <cassert>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "components/bar.hpp"
|
#include "components/bar.hpp"
|
||||||
|
@ -36,6 +36,16 @@ namespace modules {
|
|||||||
return std::make_pair(std::string(M::TYPE), get_factory<M>());
|
return std::make_pair(std::string(M::TYPE), get_factory<M>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<const char* module_type>
|
||||||
|
static factory_map::value_type map_entry_unsupported() {
|
||||||
|
return {
|
||||||
|
module_type,
|
||||||
|
[](const bar_settings&, string&&, const config&) -> module_t {
|
||||||
|
throw application_error("No built-in support for '" + string(module_type) + "'");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory function for each module type.
|
* Factory function for each module type.
|
||||||
*/
|
*/
|
||||||
@ -46,17 +56,45 @@ namespace modules {
|
|||||||
map_entry<bspwm_module>(),
|
map_entry<bspwm_module>(),
|
||||||
map_entry<cpu_module>(),
|
map_entry<cpu_module>(),
|
||||||
map_entry<date_module>(),
|
map_entry<date_module>(),
|
||||||
|
#if ENABLE_CURL
|
||||||
map_entry<github_module>(),
|
map_entry<github_module>(),
|
||||||
|
#else
|
||||||
|
map_entry_unsupported<GITHUB_TYPE>(),
|
||||||
|
#endif
|
||||||
map_entry<fs_module>(),
|
map_entry<fs_module>(),
|
||||||
map_entry<memory_module>(),
|
map_entry<memory_module>(),
|
||||||
|
#if ENABLE_I3
|
||||||
map_entry<i3_module>(),
|
map_entry<i3_module>(),
|
||||||
|
#else
|
||||||
|
map_entry_unsupported<I3_TYPE>(),
|
||||||
|
#endif
|
||||||
|
#if ENABLE_MPD
|
||||||
map_entry<mpd_module>(),
|
map_entry<mpd_module>(),
|
||||||
|
#else
|
||||||
|
map_entry_unsupported<MPD_TYPE>(),
|
||||||
|
#endif
|
||||||
|
#if ENABLE_ALSA
|
||||||
map_entry<alsa_module>(),
|
map_entry<alsa_module>(),
|
||||||
|
#else
|
||||||
|
map_entry_unsupported<ALSA_TYPE>(),
|
||||||
|
#endif
|
||||||
|
#if ENABLE_PULSEAUDIO
|
||||||
map_entry<pulseaudio_module>(),
|
map_entry<pulseaudio_module>(),
|
||||||
|
#else
|
||||||
|
map_entry_unsupported<PULSEAUDIO_TYPE>(),
|
||||||
|
#endif
|
||||||
|
#if ENABLE_NETWORK
|
||||||
map_entry<network_module>(),
|
map_entry<network_module>(),
|
||||||
|
#else
|
||||||
|
map_entry_unsupported<NETWORK_TYPE>(),
|
||||||
|
#endif
|
||||||
map_entry<temperature_module>(),
|
map_entry<temperature_module>(),
|
||||||
map_entry<xbacklight_module>(),
|
map_entry<xbacklight_module>(),
|
||||||
|
#if ENABLE_XKEYBOARD
|
||||||
map_entry<xkeyboard_module>(),
|
map_entry<xkeyboard_module>(),
|
||||||
|
#else
|
||||||
|
map_entry_unsupported<XKEYBOARD_TYPE>(),
|
||||||
|
#endif
|
||||||
map_entry<xwindow_module>(),
|
map_entry<xwindow_module>(),
|
||||||
map_entry<xworkspaces_module>(),
|
map_entry<xworkspaces_module>(),
|
||||||
map_entry<tray_module>(),
|
map_entry<tray_module>(),
|
||||||
@ -70,8 +108,8 @@ namespace modules {
|
|||||||
string actual_type = type;
|
string actual_type = type;
|
||||||
|
|
||||||
if (type == "internal/volume") {
|
if (type == "internal/volume") {
|
||||||
log.warn("internal/volume is deprecated, use %s instead", string(alsa_module::TYPE));
|
log.warn("internal/volume is deprecated, use %s instead", ALSA_TYPE);
|
||||||
actual_type = alsa_module::TYPE;
|
actual_type = ALSA_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto it = factories.find(actual_type);
|
auto it = factories.find(actual_type);
|
||||||
|
Loading…
Reference in New Issue
Block a user