Commit 3c75fb25 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Implement girara_sc_exec

parent 6a83c1f7
......@@ -504,6 +504,30 @@ girara_sc_set(girara_session_t* session, girara_argument_t* argument, girara_eve
return false;
}
bool
girara_sc_exec(girara_session_t* session, girara_argument_t* argument, girara_event_t* UNUSED(event), unsigned int UNUSED(t))
{
g_return_val_if_fail(session != NULL, false);
if (argument == NULL || argument->data == NULL) {
return false;
}
/* create argument list */
girara_list_t* argument_list = argument_to_argument_list(argument);
if (argument_list == NULL) {
return false;
}
/* call exec */
girara_cmd_exec(session, argument_list);
/* cleanup */
girara_list_free(argument_list);
return false;
}
bool
girara_sc_feedkeys(girara_session_t* session, girara_argument_t* argument,
girara_event_t* UNUSED(event), unsigned int t)
......
......@@ -211,6 +211,19 @@ bool girara_sc_toggle_tabbar(girara_session_t* session, girara_argument_t*
bool girara_sc_set(girara_session_t* session, girara_argument_t* argument,
girara_event_t* event, unsigned int t);
/**
* Executes a command.
*
* @param session The used girara session
* @param argument The argument
* @param event Girara event
* @param t Number ofexecutions
* @return true No error occurred
* @return false An error occurred (abort execution)
*/
bool girara_sc_exec(girara_session_t* session, girara_argument_t* argument,
girara_event_t* event, unsigned int t);
/**
* Default shortcut function to activate
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment