4 SCRIPTNAME=termux-notification
6 echo "usage: termux-notification [OPTIONS]"
7 echo "Display a system notification."
9 echo " -c <content> notification content to show"
10 echo " -i <id> notification id (will overwrite the previous notification with the same id)"
11 echo " -t <title> notification title to show"
12 echo " -u <url> notification url when clicking on it"
16 CONTENT_OR_TITLE_SET=no
26 while getopts :hc:i:t:u: option
30 c) ARG_C="--es content"; OPT_C="$OPTARG"; CONTENT_OR_TITLE_SET=yes;;
31 i) ARG_I="--es id"; OPT_I="$OPTARG";;
32 t) ARG_T="--es title"; OPT_T="$OPTARG"; CONTENT_OR_TITLE_SET=yes;;
33 u) ARG_U="--es url"; OPT_U="$OPTARG";;
34 ?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
39 if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
41 if [ $CONTENT_OR_TITLE_SET = "no" ]; then
42 echo "$SCRIPTNAME: no title or content set"
46 @TERMUX_API@ Notification $ARG_C "$OPT_C" $ARG_I "$OPT_I" $ARG_T "$OPT_T" $ARG_U "$OPT_U"