Skip to content

Commit

Permalink
termux-open-url: Add support to specifiy app package or component nam…
Browse files Browse the repository at this point in the history
…e so that target app directly opens instead of app chooser
  • Loading branch information
agnostic-apollo authored Jun 15, 2023
1 parent eccda5b commit 3dd05c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/termux-open-url.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/sh

if [ $# != 1 ]; then
echo 'usage: termux-open-url <url>'
if [ $# != 1 ] && [ $# != 2 ]; then
echo 'usage: termux-open-url <url> [app_package_or_component]'
echo 'Open an URL for viewing.'
exit 1
fi

am start --user 0 -a android.intent.action.VIEW -d "$1" > /dev/null
am start --user 0 -a android.intent.action.VIEW -d "$@" > /dev/null

0 comments on commit 3dd05c3

Please sign in to comment.