diff --git a/commands.c b/commands.c index 00326ba..65e94dc 100644 --- a/commands.c +++ b/commands.c @@ -523,10 +523,16 @@ cmd_exec(girara_session_t* session, girara_list_t* argument_list) const char* path = zathura_document_get_path(zathura->document); GIRARA_LIST_FOREACH(argument_list, char*, iter, value) - char* r = girara_replace_substring(value, "$FILE", path); - if (r != NULL) { - girara_list_iterator_set(iter, r); - } + char* r = girara_replace_substring(value, "$FILE", path); + + if (r != NULL) { + char* s = girara_replace_substring(r, "%", path); + g_free(r); + + if (s != NULL) { + girara_list_iterator_set(iter, s); + } + } GIRARA_LIST_FOREACH_END(argument_list, char*, iter, value); } diff --git a/config.c b/config.c index b6e1efe..d7b7ef7 100644 --- a/config.c +++ b/config.c @@ -422,6 +422,7 @@ config_load_default(zathura_t* zathura) girara_inputbar_command_add(gsession, "close", NULL, cmd_close, NULL, _("Close current file")); girara_inputbar_command_add(gsession, "info", NULL, cmd_info, NULL, _("Show file information")); girara_inputbar_command_add(gsession, "exec", NULL, cmd_exec, NULL, _("Execute a command")); + girara_inputbar_command_add(gsession, "!", NULL, cmd_exec, NULL, _("Execute a command")); /* like vim */ girara_inputbar_command_add(gsession, "help", NULL, cmd_help, NULL, _("Show help")); girara_inputbar_command_add(gsession, "open", "o", cmd_open, cc_open, _("Open document")); girara_inputbar_command_add(gsession, "quit", "q", cmd_quit, NULL, _("Close zathura"));