diff --git a/include/components/builder.hpp b/include/components/builder.hpp index c8e62447..36782dbc 100644 --- a/include/components/builder.hpp +++ b/include/components/builder.hpp @@ -48,11 +48,11 @@ class builder { void underline(const string& color = ""); void underline_close(); void control(controltag tag); - void cmd(mousebtn index, string action); - void cmd(mousebtn btn, const modules::input_handler& handler, string action); - void cmd(mousebtn index, string action, const label_t& label); - void cmd(mousebtn btn, const modules::input_handler& handler, string action, const label_t& label); - void cmd_close(); + void action(mousebtn index, string action); + void action(mousebtn btn, const modules::input_handler& handler, string action); + void action(mousebtn index, string action, const label_t& label); + void action(mousebtn btn, const modules::input_handler& handler, string action, const label_t& label); + void action_close(); protected: string background_hex(); diff --git a/include/modules/alsa.hpp b/include/modules/alsa.hpp index 2b3f52ca..f96dd44b 100644 --- a/include/modules/alsa.hpp +++ b/include/modules/alsa.hpp @@ -31,8 +31,12 @@ namespace modules { static constexpr auto TYPE = "internal/alsa"; + static constexpr auto EVENT_INC = "inc"; + static constexpr auto EVENT_DEC = "dec"; + static constexpr auto EVENT_TOGGLE = "toggle"; + protected: - bool input(string&& cmd); + bool input(string&& action); private: static constexpr auto FORMAT_VOLUME = "format-volume"; @@ -44,11 +48,6 @@ namespace modules { static constexpr auto TAG_LABEL_VOLUME = ""; static constexpr auto TAG_LABEL_MUTED = ""; - static constexpr auto EVENT_PREFIX = "vol"; - static constexpr auto EVENT_VOLUME_UP = "volup"; - static constexpr auto EVENT_VOLUME_DOWN = "voldown"; - static constexpr auto EVENT_TOGGLE_MUTE = "volmute"; - progressbar_t m_bar_volume; ramp_t m_ramp_volume; ramp_t m_ramp_headphones; diff --git a/include/modules/backlight.hpp b/include/modules/backlight.hpp index 751735c8..54fbd914 100644 --- a/include/modules/backlight.hpp +++ b/include/modules/backlight.hpp @@ -28,6 +28,9 @@ namespace modules { static constexpr auto TYPE = "internal/backlight"; + static constexpr const char* EVENT_INC = "inc"; + static constexpr const char* EVENT_DEC = "dec"; + protected: bool input(string&& cmd); @@ -36,9 +39,6 @@ namespace modules { static constexpr auto TAG_BAR = ""; static constexpr auto TAG_RAMP = ""; - static constexpr const char* EVENT_SCROLLUP{"backlight+"}; - static constexpr const char* EVENT_SCROLLDOWN{"backlight-"}; - ramp_t m_ramp; label_t m_label; progressbar_t m_progressbar; diff --git a/include/modules/bspwm.hpp b/include/modules/bspwm.hpp index be97cf8b..602d0940 100644 --- a/include/modules/bspwm.hpp +++ b/include/modules/bspwm.hpp @@ -49,8 +49,12 @@ namespace modules { static constexpr auto TYPE = "internal/bspwm"; + static constexpr auto EVENT_FOCUS = "focus"; + static constexpr auto EVENT_NEXT = "next"; + static constexpr auto EVENT_PREV = "prev"; + protected: - bool input(string&& cmd); + bool input(string&& action); private: bool handle_status(string& data); @@ -63,11 +67,6 @@ namespace modules { static constexpr auto TAG_LABEL_STATE = ""; static constexpr auto TAG_LABEL_MODE = ""; - static constexpr const char* EVENT_PREFIX{"bspwm-desk"}; - static constexpr const char* EVENT_CLICK{"bspwm-deskfocus"}; - static constexpr const char* EVENT_SCROLL_UP{"bspwm-desknext"}; - static constexpr const char* EVENT_SCROLL_DOWN{"bspwm-deskprev"}; - bspwm_util::connection_t m_subscriber; vector> m_monitors; diff --git a/include/modules/date.hpp b/include/modules/date.hpp index 6639b759..9b4fd224 100644 --- a/include/modules/date.hpp +++ b/include/modules/date.hpp @@ -18,12 +18,13 @@ namespace modules { static constexpr auto TYPE = "internal/date"; + static constexpr auto EVENT_TOGGLE = "toggle"; + protected: - bool input(string&& cmd); + bool input(string&& action); private: static constexpr auto TAG_LABEL = "