feat(clock): Add action to execute external command
This commit is contained in:
@@ -80,6 +80,7 @@ class Clock final : public ALabel {
|
||||
void cldShift_reset();
|
||||
void tz_up();
|
||||
void tz_down();
|
||||
void action_exec(const std::string& action);
|
||||
// Module Action Map
|
||||
static inline std::map<const std::string, void (waybar::modules::Clock::* const)()> actionMap_{
|
||||
{"mode", &waybar::modules::Clock::cldModeSwitch},
|
||||
@@ -88,6 +89,8 @@ class Clock final : public ALabel {
|
||||
{"shift_reset", &waybar::modules::Clock::cldShift_reset},
|
||||
{"tz_up", &waybar::modules::Clock::tz_up},
|
||||
{"tz_down", &waybar::modules::Clock::tz_down}};
|
||||
static inline std::map<const std::string, void (waybar::modules::Clock::* const)(const std::string& action)> actionWithArgsMap_{
|
||||
{"exec", &waybar::modules::Clock::action_exec}};
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
||||
|
||||
Reference in New Issue
Block a user