diff --git a/include/modules/backlight.hpp b/include/modules/backlight.hpp index ecbc6897..b62220df 100644 --- a/include/modules/backlight.hpp +++ b/include/modules/backlight.hpp @@ -1,13 +1,14 @@ #pragma once #include "components/config.hpp" -#include "settings.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 { + class backlight_module : public inotify_module, public input_handler { public: struct brightness_handle { void filepath(const string& path); @@ -17,6 +18,8 @@ namespace modules { string m_path; }; + string get_output(); + public: explicit backlight_module(const bar_settings&, string); @@ -24,20 +27,29 @@ namespace modules { bool on_event(inotify_event* event); bool build(builder* builder, const string& tag) const; + protected: + bool input(string&& cmd); + private: static constexpr auto TAG_LABEL = "