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'] = ['choose_browser.sh', '%s']