diff --git a/bin/command-list b/bin/command-list index 6fa59db..de42b0b 100755 --- a/bin/command-list +++ b/bin/command-list @@ -168,11 +168,15 @@ if result.returncode != 0: exit(result.returncode) choice = result.stdout.strip() -val = vals[choice] - -if val["kind"] == "bin": - subprocess.run([val["path"]]) -elif val["kind"] == "app": - subprocess.run(["gtk-launch", val["name"]]) -elif val["kind"] == "url": - subprocess.run(["xdg-open", val["url"]]) +if choice[0] == '@': + choice = choice[1:] +val = vals.get(choice) +if val is not None: + if val["kind"] == "bin": + subprocess.run([val["path"]]) + elif val["kind"] == "app": + subprocess.run(["gtk-launch", val["name"]]) + elif val["kind"] == "url": + subprocess.run(["xdg-open", val["url"]]) +else: + subprocess.run(["xdg-open", "https://www.google.com/search?q=" + choice])