#!/bin/sh # DIALOG_CMD - Prompt command. # # Note, if you don't have dialog, you may have whiptail(1). If one # doesn't work, comment out the dialog line and try the whiptail one. # If that doesn't work, it's probably time to install one of the two and # try again :). DIALOG_CMD="dialog --stderr" # DIALOG_CMD=whiptail # grab URL from command-line url="$1" if [ "x$url" = "x" ]; then echo "Usage: $0 " exit -1 fi # create tempfile out="$(tempfile -p open_with)" # choose browser $DIALOG_CMD --menu 'Please Choose a Browser' 10 40 2 \ 1 Links \ 2 Firefox \ 2>"$out" # read arg, remove tempfile val=$(cat "$out"); rm -f "$out" # process command if [ "x$val" = "x1" ]; then links "$url" elif [ "x$val" = "x2" ]; then # modify this command to suire your needs, or add additional commands firefox --remote "openurl($url, new-tab)" fi