From 8c6fe0ad321a263ee56a3d6439d7b99630a1755c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Fri, 5 Aug 2022 09:57:39 +0200 Subject: Integrate dconf-editor This is a more than adequate solution for now. --- docs/fiv.html | 10 +++++----- fiv.c | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/docs/fiv.html b/docs/fiv.html index 75f712d..5a9b918 100644 --- a/docs/fiv.html +++ b/docs/fiv.html @@ -95,16 +95,16 @@ rm -rf ~/.cache/thumbnails/wide-*

Configuration

The few configuration options fiv has can be adjusted using -dconf-editor or gsettings. - -

-dconf-editor name.janouch.fiv
-
+dconf-editor, which can be launched in the appropriate location from +within the application by pressing Ctrl+,. For command line usage, there is +the gsettings utility:
 gsettings list-recursively name.janouch.fiv
 
+

To make your changes take effect, restart fiv. +

Theming

The standard means to adjust the looks of the program is through GTK+ 3 CSS. diff --git a/fiv.c b/fiv.c index 723780e..57fee50 100644 --- a/fiv.c +++ b/fiv.c @@ -82,6 +82,7 @@ struct key_section { static struct key help_keys_general[] = { {"F1", "Show help"}, {"F10", "Open menu"}, + {"comma", "Preferences"}, {"question", "Keyboard shortcuts"}, {"q q", "Quit"}, {"w", "Quit"}, @@ -1126,6 +1127,20 @@ show_help_shortcuts(void) gtk_widget_show(window); } +static void +show_preferences(void) +{ + char *argv[] = {"dconf-editor", PROJECT_NS PROJECT_NAME, NULL}; + GError *error = NULL; + if (!g_spawn_async( + NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error)) { + if (g_error_matches(error, G_SPAWN_ERROR, G_SPAWN_ERROR_NOENT)) + g_prefix_error_literal(&error, + "Please install dconf-editor, or use the gsettings utility.\n"); + show_error_dialog(error); + } +} + static void toggle_sunlight(void) { @@ -1182,6 +1197,9 @@ on_key_press(G_GNUC_UNUSED GtkWidget *widget, GdkEventKey *event, case GDK_KEY_question: show_help_shortcuts(); return TRUE; + case GDK_KEY_comma: + show_preferences(); + return TRUE; } break; case GDK_MOD1_MASK: -- cgit v1.2.3