From 7b541d0a6d196499712f4e7c9854aa294ac16167 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Wed, 20 May 2020 14:14:49 +0200 Subject: Add /executable command This is used to set the openers for various commands. So far for /avatar and /urlopen. --- src/command/cmd_defs.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'src/command/cmd_defs.c') diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 398badc0..3cf019b5 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -2340,26 +2340,23 @@ static struct cmd_t command_defs[] = }, { "/avatar", - parse_args, 2, 2, &cons_avatar_setting, + parse_args, 2, 2, NULL, CMD_NOSUBFUNCS CMD_MAINFUNC(cmd_avatar) CMD_TAGS( CMD_TAG_CHAT) CMD_SYN( "/avatar get ", - "/avatar open ", - "/avatar cmd ") + "/avatar open ") CMD_DESC( "Download avatar (XEP-0084) for a certain contact. " "If nothing happens after using this command the user either doesn't have an avatar set at all " "or doesn't use XEP-0084 to publish it.") CMD_ARGS( { "get ", "Download the avatar. barejid is the JID to download avatar from."}, - { "cmd ", "Set a command to execute with 'avatar open'. Use your favourite image viewer here."}, { "open ", "Download avatar and open it with command."}) CMD_EXAMPLES( "/avatar get thor@valhalla.edda", - "/avatar cmd xdg-open", "/avatar open freyja@vanaheimr.edda") }, @@ -2466,6 +2463,26 @@ static struct cmd_t command_defs[] = { "", "URL to open."}) CMD_NOEXAMPLES }, + + { "/executable", + parse_args, 2, 2, &cons_executable_setting, + CMD_NOSUBFUNCS + CMD_MAINFUNC(cmd_executable) + CMD_TAGS( + CMD_TAG_DISCOVERY) + CMD_SYN( + "/executable avatar ", + "/executable urlopen ") + CMD_DESC( + "Configure executable that should be called upon a certain command." + "Default is xdg-open.") + CMD_ARGS( + { "avatar", "Set executable that is run in /avatar open. Use your favourite image viewer." }, + { "urlopen", "Set executable that is run in /urlopen. Use your favourite browser." }) + CMD_EXAMPLES( + "/executable avatar xdg-open", + "/executable urlopen firefox") + }, }; static GHashTable *search_index; -- cgit 1.4.1-2-gfad0