diff options
author | Daniel Santos <dacs.git@brilhante.top> | 2023-03-24 14:56:35 +0000 |
---|---|---|
committer | Daniel Santos <dan.git@brilhante.top> | 2023-07-01 10:08:20 +0100 |
commit | 35351387a197e55f5389545efe3941b58ca94ffd (patch) | |
tree | 87bba0f195ad83c9f895f91f1119cd099b954c71 /src/command/cmd_defs.c | |
parent | c402f8d9d2b3f94bbc20ba9c0c43f6df3b7ca885 (diff) | |
download | profani-tty-35351387a197e55f5389545efe3941b58ca94ffd.tar.gz |
/executable async on|off
* rename call_external() to call_external_async(). * add call_external_fork(). This function makes all executable calls to be forked and synchronous. So that running profanity inside a TTY, we can set all executables to be TTY programs (fbi, mpv, w3m, emacs eww, etc.), making possible to open urls or see images inside the TTY. * add '/executable async' command. * make call_external() use either call_external_async() or call_external_fork(), according to the '/executable async' configuration. Signed-off-by: Daniel Santos <dacs.git@brilhante.top>
Diffstat (limited to 'src/command/cmd_defs.c')
-rw-r--r-- | src/command/cmd_defs.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 9bc8b6f2..1aee5fb8 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -2531,7 +2531,8 @@ static const struct cmd_t command_defs[] = { { "urlopen", cmd_executable_urlopen }, { "urlsave", cmd_executable_urlsave }, { "editor", cmd_executable_editor }, - { "vcard_photo", cmd_executable_vcard_photo }) + { "vcard_photo", cmd_executable_vcard_photo }, + { "async", cmd_executable_async }) CMD_TAGS( CMD_TAG_DISCOVERY) CMD_SYN( @@ -2544,7 +2545,8 @@ static const struct cmd_t command_defs[] = { "/executable editor set <cmdtemplate>", "/executable editor default", "/executable vcard_photo set <cmdtemplate>", - "/executable vcard_photo default") + "/executable vcard_photo default", + "/executable async on|off") CMD_DESC( "Configure executable that should be called upon a certain command.") CMD_ARGS( @@ -2557,7 +2559,8 @@ static const struct cmd_t command_defs[] = { { "editor set", "Set editor to be used with /editor. Needs a terminal editor or a script to run a graphical editor." }, { "editor default", "Restore to default settings." }, { "vcard_photo set", "Set executable that is run by /vcard photo open. Takes a command template that replaces %p with the path" }, - { "vcard_photo default", "Restore to default settings." }) + { "vcard_photo default", "Restore to default settings." }, + { "async on|off", "Enable or disable async call of executables. Disable async if all executables run inside the TTY." }) CMD_EXAMPLES( "/executable avatar xdg-open", "/executable urlopen set \"xdg-open %u\"", @@ -2566,8 +2569,9 @@ static const struct cmd_t command_defs[] = { "/executable urlsave set \"wget %u -O %p\"", "/executable urlsave set \"curl %u -o %p\"", "/executable urlsave default", + "/executable editor set \"emacsclient -t\"", "/executable vcard_photo set \"feh %p\"", - "/executable editor set \"emacsclient -t\"") + "/executable async off") }, { CMD_PREAMBLE("/url", |