polybar-dwm/include/utils/actions.hpp

32 lines
825 B
C++
Raw Normal View History

#pragma once
#include "common.hpp"
namespace modules {
struct module_interface;
} // namespace modules
POLYBAR_NS
namespace actions_util {
2020-11-25 09:16:26 +00:00
using action = std::tuple<string, string, string>;
string get_action_string(const modules::module_interface& module, string action, string data);
2020-05-31 14:28:31 +00:00
/**
* Parses an action string of the form "#name.action[.data]".
*
* Only call this function with an action string that begins with '#'.
*
* \returns a triple (name, action, data)
* If no data exists, the third string will be empty.
* This means "#name.action." and "#name.action" will be produce the
* same result.
* \throws runtime_error If the action string is malformed
*/
2020-11-25 09:16:26 +00:00
action parse_action_string(string action);
} // namespace actions_util
POLYBAR_NS_END