diff --git a/config.def.h b/config.def.h index e71583b..74ca395 100644 --- a/config.def.h +++ b/config.def.h @@ -104,6 +104,7 @@ Shortcut shortcuts[] = { {GDK_SHIFT_MASK, GDK_question, sc_focus_inputbar, NORMAL, { .data = "?" } }, {0, GDK_colon, sc_focus_inputbar, NORMAL, { .data = ":" } }, {0, GDK_o, sc_focus_inputbar, NORMAL, { .data = ":open " } }, + {0, GDK_O, sc_focus_inputbar, NORMAL, { APPEND_FILEPATH, .data = ":open " } }, {0, GDK_f, sc_follow, NORMAL, {0} }, {0, GDK_J, sc_navigate, NORMAL, { NEXT } }, {0, GDK_K, sc_navigate, NORMAL, { PREVIOUS } }, diff --git a/zathura.c b/zathura.c index 38e2c85..c8fb8e7 100644 --- a/zathura.c +++ b/zathura.c @@ -28,7 +28,7 @@ enum { NEXT, PREVIOUS, LEFT, RIGHT, UP, DOWN, BOTTOM, TOP, HIDE, HIGHLIGHT, BACKWARD, ADJUST_BESTFIT, ADJUST_WIDTH, ADJUST_NONE, CONTINUOUS, DELETE_LAST, ADD_MARKER, EVAL_MARKER, EXPAND, COLLAPSE, SELECT, GOTO_DEFAULT, GOTO_LABELS, GOTO_OFFSET, HALF_UP, HALF_DOWN, FULL_UP, FULL_DOWN, NEXT_CHAR, PREVIOUS_CHAR, - DELETE_TO_LINE_START }; + DELETE_TO_LINE_START, APPEND_FILEPATH }; /* define modes */ #define ALL (1 << 0) @@ -1989,7 +1989,15 @@ sc_focus_inputbar(Argument* argument) if(argument->data) { - notify(DEFAULT, argument->data); + char* data = argument->data; + + if(argument->n == APPEND_FILEPATH) + data = g_strdup_printf("%s%s", data, Zathura.PDF.file); + else + data = g_strdup(data); + + notify(DEFAULT, data); + g_free(data); gtk_widget_grab_focus(GTK_WIDGET(Zathura.UI.inputbar)); gtk_editable_set_position(GTK_EDITABLE(Zathura.UI.inputbar), -1); }