@@ -17,6 +17,10 @@ show_usage () {
1717 echo " -c/--content content content to show in the notification. Will take"
1818 echo " precedence over stdin. If content is not passed as"
1919 echo " an argument or with stdin, then there will be a 3s delay."
20+ echo " --channel channel-id Specifies the notification channel id this notification should be send on."
21+ echo " On Android versions lower than 8.0 this is a no-op."
22+ echo " Create custom channels with termux-notification-channel."
23+ echo " If the channel id is invalid, the notification will not be send."
2024 echo " --group group notification group (notifications with the same"
2125 echo " group are shown together)"
2226 echo " -h/--help show this help"
@@ -88,6 +92,7 @@ OPT_BUTTON3_ACTION=""
8892OPT_BUTTON3_TEXT=" "
8993OPT_CONTENT=" "
9094OPT_CONTENT_PASSED=" "
95+ OPT_CHANNEL=" "
9196OPT_GROUP=" "
9297OPT_ID=" "
9398OPT_ICON=" "
@@ -114,7 +119,7 @@ TEMP=`getopt \
114119button1:,button1-action:,\
115120button2:,button2-action:,\
116121button3:,button3-action:,\
117- content:,group:,help,help-actions,\
122+ content:,channel:, group:,help,help-actions,\
118123id:,icon:,image-path:,\
119124led-color:,led-on:,led-off:,\
120125media-previous:,media-next:,media-play:,media-pause:,\
@@ -136,6 +141,7 @@ while true; do
136141 --button3) OPT_BUTTON3_TEXT=" $2 " ; shift 2;;
137142 --button3-action) OPT_BUTTON3_ACTION=" $2 " ; shift 2;;
138143 -c | --content) OPT_CONTENT_PASSED=1; OPT_CONTENT=" $2 " ; shift 2;;
144+ --channel) OPT_CHANNEL=" $2 " ; shift 2;;
139145 --group) OPT_GROUP=" $2 " ; shift 2;;
140146 -h | --help) show_usage;;
141147 --help-actions) show_help_actions; exit 0;;
@@ -177,6 +183,7 @@ if [ -n "$OPT_BUTTON2_ACTION" ]; then set -- "$@" --es button_action_2 "$OPT_BUT
177183if [ -n " $OPT_BUTTON2_TEXT " ]; then set -- " $@ " --es button_text_2 " $OPT_BUTTON2_TEXT " ; fi
178184if [ -n " $OPT_BUTTON3_ACTION " ]; then set -- " $@ " --es button_action_3 " $OPT_BUTTON3_ACTION " ; fi
179185if [ -n " $OPT_BUTTON3_TEXT " ]; then set -- " $@ " --es button_text_3 " $OPT_BUTTON3_TEXT " ; fi
186+ if [ -n " $OPT_CHANNEL " ]; then set -- " $@ " --es channel " $OPT_CHANNEL " ; fi
180187if [ -n " $OPT_GROUP " ]; then set -- " $@ " --es group " $OPT_GROUP " ; fi
181188if [ -n " $OPT_ID " ]; then set -- " $@ " --es id " $OPT_ID " ; fi
182189if [ -n " $OPT_ICON " ]; then set -- " $@ " --es icon " $OPT_ICON " ; fi
0 commit comments