Skip to content

Commit c72a9a9

Browse files
benmoranxalexalex
authored andcommitted
termux-notification --help-actions update for direct reply (termux-api #320)
1 parent 666646a commit c72a9a9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

scripts/termux-notification

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ show_help_actions () {
5858
echo "The action is run in a different environment (not a subshell). Thus your environment is lost (most notably \$PATH), and ~/.profile is not sourced either. So if you need your \$PATH you should either:"
5959
echo " - if the action is a script, set it explicitly in the script (e.g. export PATH=\"\$HOME/bin:\$PATH\")"
6060
echo " - or use something like --action \"bash -l -c 'command1; command2'\")."
61+
echo
62+
echo "On Android N or above, you can use the special variable \$REPLY in your actions to use Android's Direct Reply feature."
63+
echo "This prompts the user to enter some text directly in the notification, which is then substituted into your action."
64+
echo " - termux-notification --button1 \"Answer\" --button1-action \"termux-toast \\\$REPLY\""
65+
echo "will call the action:"
66+
echo " - termux-toast \"Some text entered by the user\""
67+
echo "Be careful to escape shell commands correctly for single or double quotes, e.g."
68+
echo " --button1-action 'something \$REPLY' or --button1-action \"something \\\$REPLY\""
6169
}
6270

6371
OPT_ACTION=""

0 commit comments

Comments
 (0)