2020-05-06 23:26:14 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common.hpp"
|
|
|
|
#include "modules/meta/input_handler.hpp"
|
|
|
|
|
|
|
|
POLYBAR_NS
|
|
|
|
|
|
|
|
namespace actions_util {
|
2020-05-23 22:36:16 +00:00
|
|
|
string get_action_string(const modules::input_handler& handler, 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
|
|
|
|
*/
|
|
|
|
std::tuple<string, string, string> parse_action_string(string action);
|
2020-05-06 23:26:14 +00:00
|
|
|
} // namespace actions_util
|
|
|
|
|
|
|
|
POLYBAR_NS_END
|