refactor: Move module type string into modules

This allows us to identify module by their type and it is also better to
store the module type as part of the module instead of having it
hardcoded in factory.hpp
This commit is contained in:
patrick96 2020-05-15 19:59:08 +02:00 committed by Patrick Ziegler
parent 06012af3aa
commit d592eea966
30 changed files with 137 additions and 89 deletions
include/modules

View file

@ -2,13 +2,12 @@
#include "components/config.hpp"
#include "modules/meta/inotify_module.hpp"
#include "modules/meta/input_handler.hpp"
#include "settings.hpp"
POLYBAR_NS
namespace modules {
class backlight_module : public inotify_module<backlight_module>, public input_handler {
class backlight_module : public inotify_module<backlight_module> {
public:
struct brightness_handle {
void filepath(const string& path);
@ -27,6 +26,8 @@ namespace modules {
bool on_event(inotify_event* event);
bool build(builder* builder, const string& tag) const;
static constexpr auto TYPE = "internal/backlight";
protected:
bool input(string&& cmd);