diff --git a/config/config.c b/config/config.c index 1345891b5..6e256e53c 100644 --- a/config/config.c +++ b/config/config.c @@ -125,6 +125,8 @@ Settings config = { .drun_show_actions = FALSE, /** Desktop format display */ .drun_display_format = "{name} [({generic})]", + /** Desktop Link launch command */ + .drun_url_launcher = "xdg-open", /** Window fields to match in window mode*/ .window_match_fields = "all", diff --git a/include/settings.h b/include/settings.h index 683ede84c..cecb9c34b 100644 --- a/include/settings.h +++ b/include/settings.h @@ -128,6 +128,8 @@ typedef struct unsigned int drun_show_actions; /** Desktop format display */ char * drun_display_format; + /** Desktop Link launch command */ + char * drun_url_launcher; /** Search case sensitivity */ unsigned int case_sensitive; diff --git a/source/dialogs/drun.c b/source/dialogs/drun.c index 540bb0bfa..26fe73a17 100644 --- a/source/dialogs/drun.c +++ b/source/dialogs/drun.c @@ -57,7 +57,6 @@ #define DRUN_CACHE_FILE "rofi3.druncache" #define DRUN_DESKTOP_CACHE_FILE "rofi-drun-desktop.cache" -#define XDG_OPEN_COMMAND "xdg-open" char *DRUN_GROUP_NAME = "Desktop Entry"; @@ -245,9 +244,9 @@ static void launch_link_entry ( DRunModeEntry *e ) return ; } - gsize command_len = strlen( XDG_OPEN_COMMAND ) + strlen( url ) + 2; // space + terminator = 2 + gsize command_len = strlen( config.drun_url_launcher ) + strlen( url ) + 2; // space + terminator = 2 gchar *command = g_newa ( gchar, command_len ); - g_snprintf( command, command_len, "%s %s", XDG_OPEN_COMMAND, url ); + g_snprintf( command, command_len, "%s %s", config.drun_url_launcher, url ); g_free ( url ); g_debug ( "Link launch command: |%s|", command ); diff --git a/source/xrmoptions.c b/source/xrmoptions.c index 9b55bd683..94322edcb 100644 --- a/source/xrmoptions.c +++ b/source/xrmoptions.c @@ -141,6 +141,8 @@ static XrmOption xrmOptions[] = { "Desktop entry show actions.", CONFIG_DEFAULT }, { xrm_String, "drun-display-format", { .str = &config.drun_display_format }, NULL, "DRUN format string. (Supports: generic,name,comment,exec,categories)", CONFIG_DEFAULT }, + { xrm_String, "drun-url-launcher", { .str = &config.drun_url_launcher }, NULL, + "Command to open an Desktop Entry that is a Link.", CONFIG_DEFAULT }, { xrm_Boolean, "disable-history", { .num = &config.disable_history }, NULL, "Disable history in run/ssh", CONFIG_DEFAULT },