* Christian Herenz (herenz9@netscape.net) wrote: > > > abi@grinser.de wrote: > > >hi, > > > >On Mon, Nov 28, 2005 at 07:49:44AM -0600, brian wrote: > > > > > >>I think it's possible and would be really useful. In firefox, the > >>command is firefox -remote "openurl($url, new-tab)". I'd care more > >>about this, but the Bignum/YAML bug is making raggle unusable for me > >>right now. > >> > > As I understood him, he wanted to know if there are to keys bindable, > one for elinks another for Opera. This is as I know not possible at the > moment. This should maybe be a feature implemented in future versions. Technically Raggle only accepts one browser (the one defined in the config, or in the environment). That said, you can cheat and add an extra method, and the associated key binding. Try adding the following to your ~/.raggle/config.rb: module Raggle module Interfaces module NcursesInterface module Key def Key::open_alternate_link # save current browser settings old_browser = $config['browser_cmd'] # set alternate browser, open link $config['browser_cmd'] = $config['alternate_browser_cmd'] Key.open_link # restore browser $config['browser_cmd'] = old_browser end end end end end # bind open_alternate to shift-A # (note that this needs to come _before_ any other changes to $config) $config['keys'][?A] = proc { |win, key| Raggle::Interfaces::NcursesInterface::Key.open_alternate_link } # set alternate browser command $config['alternate_browser_cmd'] = ['firefox', 'openurl(%s, new-tab)'] Note that this kind of config file chicanery isn't guaranteed to be forward-compatible, although it probably won't break for any future 0.4.x Raggle releases. Alternatively, you can set your browser command to your own personal script, and toggle the browser from there. Something like this, for example: #!/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 Drop that into a file called "choose_browser.sh" somewhere in your path (I prefer $HOME/bin), set it executable (chmod 750 choose_browser.sh), , then add the following line to your Raggle config: $config['browser_cmd'] = ['choose_browser.sh', '%s'] ... Either method works. The second method is slightly more inconvenient from a user interface point of view, since you have to press a couple extra keys each time you open a link. On the other hand, the second method is also less invasive, and it also works with the 1-9 open link shortcuts. If you're feeling extra mischievous, you can combine the two methods by adding the alternate browser command to your config file, then setting your alternate browser to the choose_browser.sh script. Then, you can add any browser you want to the choose_browser script, and access it via the alternate browser command. I've attached all of the examples above in case your email client munges whitespace. They're also available at the following URL: http://raggle.org/files/alternate_browser/ Hope this helps... -- Paul Duncan OpenPGP Key ID: 0x82C29562 http://www.pablotron.org/ http://www.paulduncan.org/