Hi, I'm using the contextual menu and ask if posible to add a parameter like for example %f to send the actual file to the contextual action. So for example can be use like this : /xxxx/yyy/context_action.sh "%s" "%f" - so the 2ª parameter be the macro of the actual file
I understand that this request is a very "personal" issue, so if it can not be considered, please, can you give a tip "which" source I have to check & modify, so I can do it by myself.
Thanxs & hugs, Andrés
Context action works on the buffer, so I'm not sure we would want to make filename available as a normal thing, since the buffer might not be saved to the file when the command is performed, so you would need to provide a use-case for it.
If you have a good use-case and you are going to make the change you could make a pull request to contribute it back.
Look in `callbacks.c/on_context_action1_activate()`
Hi, thanxs for your guide, I have modified and works fine, here the snippet( in callbacks.c/on_context_action1_activate() ) : - - - - - - - - - - - - - - - - - - - - - - - - /* substitute the wildcard %s and run the command if it is non empty */ if (G_LIKELY(!EMPTY(command))) { gchar *command_line = g_strdup(command);
utils_str_replace_all(&command_line, "%s", word);
// file name added as %f utils_str_replace_all(&command_line, "%f", doc->file_name);
if (!spawn_async(NULL, command_line, NULL, NULL, NULL, &error)) { - - - - - - - - - - - - - - - - - - - - - - - -
As for why I need this change( use-case ) let me write an example & send u to consider.
Thanxs & hugs, Andrés
github-comments@lists.geany.org