From 423ee4e93bde3b9a82ed9d76e8de196e430626f8 Mon Sep 17 00:00:00 2001 From: giomatfois62 Date: Fri, 2 Feb 2024 12:27:15 +0100 Subject: [PATCH] added -preview-cmd string option to program settings --- config/config.c | 3 +++ include/settings.h | 3 +++ source/xrmoptions.c | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/config/config.c b/config/config.c index 7bde97035..4fa34eda7 100644 --- a/config/config.c +++ b/config/config.c @@ -45,6 +45,9 @@ Settings config = { /** Whether to load and show icons */ .show_icons = FALSE, + + /** Custom command to generate preview icons */ + .preview_cmd = NULL, /** Terminal to use. (for ssh and open in terminal) */ .terminal_emulator = "rofi-sensible-terminal", diff --git a/include/settings.h b/include/settings.h index 1af9b9527..5da4279fc 100644 --- a/include/settings.h +++ b/include/settings.h @@ -60,6 +60,9 @@ typedef struct { /** Whether to load and show icons */ gboolean show_icons; + + /** Custom command to generate preview icons */ + char *preview_cmd; /** Terminal to use */ char *terminal_emulator; diff --git a/source/xrmoptions.c b/source/xrmoptions.c index c2f6efc28..72e16bc1b 100644 --- a/source/xrmoptions.c +++ b/source/xrmoptions.c @@ -128,6 +128,13 @@ static XrmOption xrmOptions[] = { NULL, "Whether to load and show icons", CONFIG_DEFAULT}, + + {xrm_String, + "preview-cmd", + {.str = &config.preview_cmd}, + NULL, + "Custom command to generate preview icons", + CONFIG_DEFAULT}, {xrm_String, "terminal",