urlhandler: Don't show GUI if only one choice.

This commit is contained in:
tastytea 2020-05-27 06:20:45 +02:00
parent d37d054fe8
commit 462a63d31b
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 2 additions and 1 deletions

View File

@ -29,7 +29,8 @@ for url in ${@}; do
for regex cmd in ${(kv)assignments}; do
if [[ "${url}" -regex-match "${regex}" ]]; then
if [ "$(basename ${0})" = "urlhandler-gui" ]; then
if [ "$(basename ${0})" = "urlhandler-gui" ] &&
[[ $(tr -d -c ';' <<<${cmd} | wc -c) -gt 1 ]]; then
# Show a dialogue with commands to choose from
choice=$(zenity --list --column="commands" --hide-header ${(s:;:)cmd})
if [ -n "${choice}" ]; then