__system_property_get is now public for 64-bit
[termux-packages] / packages / termux-api / termux-notification
CommitLineData
cc1ae02e 1#!/bin/sh
0ec2b704 2set -e -u
59f0d218 3
0ec2b704 4SCRIPTNAME=termux-notification
59f0d218
FF
5show_usage () {
6 echo "usage: termux-notification [OPTIONS]"
0ec2b704
FF
7 echo "Display a system notification."
8 echo ""
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"
13 exit 1
59f0d218
FF
14}
15
0ec2b704
FF
16CONTENT_OR_TITLE_SET=no
17ARG_C=""
18OPT_C=""
19ARG_I=""
20OPT_I=""
21ARG_T=""
22OPT_T=""
23ARG_U=""
24OPT_U=""
25
26while getopts :hc:i:t:u: option
27do
28 case "$option" in
29 h) show_usage;;
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;
35 esac
59f0d218 36done
0ec2b704
FF
37shift $(($OPTIND-1))
38
39if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
59f0d218
FF
40
41if [ $CONTENT_OR_TITLE_SET = "no" ]; then
0ec2b704
FF
42 echo "$SCRIPTNAME: no title or content set"
43 exit 1
44fi
59f0d218 45
0ec2b704 46@TERMUX_API@ Notification $ARG_C "$OPT_C" $ARG_I "$OPT_I" $ARG_T "$OPT_T" $ARG_U "$OPT_U"