diff --git a/config.c b/config.c index a2ff814..af172d0 100644 --- a/config.c +++ b/config.c @@ -152,6 +152,8 @@ config_load_default(zathura_t* zathura) girara_setting_add(gsession, "nohlsearch", &bool_value, BOOLEAN, false, _("Highlight search results"), cb_nohlsearch_changed, NULL); bool_value = true; girara_setting_add(gsession, "abort-clear-search", &bool_value, BOOLEAN, false, _("Clear search results on abort"), NULL, NULL); + bool_value = false; + girara_setting_add(gsession, "window-title-basename", &bool_value, BOOLEAN, false, _("Use basename of the file in the window title"), NULL, NULL); /* define default shortcuts */ girara_shortcut_add(gsession, GDK_CONTROL_MASK, GDK_KEY_c, NULL, sc_abort, 0, 0, NULL); diff --git a/zathura.c b/zathura.c index 4ea0b51..bd6c195 100644 --- a/zathura.c +++ b/zathura.c @@ -656,7 +656,15 @@ document_open(zathura_t* zathura, const char* path, const char* password) zathura_bookmarks_load(zathura, file_path); /* update title */ - girara_set_window_title(zathura->ui.session, file_path); + bool basename_only = false; + girara_setting_get(zathura->ui.session, "window-title-basename", &basename_only); + if (basename_only == false) { + girara_set_window_title(zathura->ui.session, file_path); + } else { + char* tmp = g_path_get_basename(file_path); + girara_set_window_title(zathura->ui.session, tmp); + g_free(tmp); + } g_free(file_uri); diff --git a/zathurarc.5.rst b/zathurarc.5.rst index 652e04d..4c03e20 100644 --- a/zathurarc.5.rst +++ b/zathurarc.5.rst @@ -581,7 +581,7 @@ scroll-hstep ^^^^^^^^^^^^ Defines the horizontal step size of scrolling by calling the scroll command once -* Value-type: Float +* Value type: Float * Default value: -1 scroll-step @@ -602,14 +602,21 @@ search-hadjust ^^^^^^^^^^^^^^ En/Disables horizontally centered search results -* Value-type: Boolean +* Value type: Boolean * Default value: true +window-title-basename +^^^^^^^^^^^^^^^^^^^^^ +Use basename of the file in the window title. + +* Value type: Boolean +* Default value: false + zoom-center ^^^^^^^^^^^ En/Disables horizontally centered zooming -* Value-type: Bool +* Value type: Bool * Default value: False zoom-max