We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d9e1d69 commit d803d16Copy full SHA for d803d16
1 file changed
scripts/termux-notification
100755
100644
@@ -141,4 +141,10 @@ if [ -n "$OPT_TITLE" ]; then set -- "$@" --es title "$OPT_TITLE"; fi
141
if [ -n "$OPT_TYPE" ]; then set -- "$@" --es type "$OPT_TYPE"; fi
142
if [ -n "$OPT_VIBRATE" ]; then set -- "$@" --ela vibrate "$OPT_VIBRATE"; fi
143
144
-echo "$OPT_CONTENT" | /data/data/com.termux/files/usr/libexec/termux-api Notification "$@"
+if [ -n "$OPT_CONTENT" ] || [ -t 0 ]; then
145
+ # we either have some content, so it takes precedence over STDIN
146
+ # or have no STDIN, so we must use content even if empty
147
+ echo "$OPT_CONTENT" | /data/data/com.termux/files/usr/libexec/termux-api Notification "$@"
148
+else # use STDIN
149
+ /data/data/com.termux/files/usr/libexec/termux-api Notification "$@"
150
+fi
0 commit comments