diff --git a/config.c b/config.c index 2a3ca9c..5eafc0d 100644 --- a/config.c +++ b/config.c @@ -208,6 +208,8 @@ config_load_default(zathura_t* zathura) 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); bool_value = false; + girara_setting_add(gsession, "statusbar-basename", &bool_value, BOOLEAN, false, _("Use basename of the file in the statusbar"), NULL, NULL); + bool_value = false; girara_setting_add(gsession, "synctex", &bool_value, BOOLEAN, false, _("Enable synctex support"), NULL, NULL); /* define default shortcuts */ diff --git a/zathura.c b/zathura.c index b499801..80bf2fb 100644 --- a/zathura.c +++ b/zathura.c @@ -581,7 +581,15 @@ document_open(zathura_t* zathura, const char* path, const char* password) } /* update statusbar */ - girara_statusbar_item_set_text(zathura->ui.session, zathura->ui.statusbar.file, file_path); + bool basename_only = false; + girara_setting_get(zathura->ui.session, "statusbar-basename", &basename_only); + if (basename_only == false) { + girara_statusbar_item_set_text(zathura->ui.session, zathura->ui.statusbar.file, file_path); + } else { + char* tmp = g_path_get_basename(file_path); + girara_statusbar_item_set_text(zathura->ui.session, zathura->ui.statusbar.file, tmp); + g_free(tmp); + } /* install file monitor */ gchar* file_uri = g_filename_to_uri(file_path, NULL, NULL); @@ -690,7 +698,7 @@ document_open(zathura_t* zathura, const char* path, const char* password) zathura_bookmarks_load(zathura, file_path); /* update title */ - bool basename_only = false; + 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); diff --git a/zathurarc.5.rst b/zathurarc.5.rst index 6630331..f317aa6 100644 --- a/zathurarc.5.rst +++ b/zathurarc.5.rst @@ -658,6 +658,13 @@ Use basename of the file in the window title. * Value type: Boolean * Default value: false +statusbar-basename +^^^^^^^^^^^^^^^^^^ +Use basename of the file in the statusbar. + +* Value type: Boolean +* Default value: false + zoom-center ^^^^^^^^^^^ En/Disables horizontally centered zooming