I'm trying to figure out how to set the default web browser on OS X via command line. I found this [forum post](http://hintsforums.macworld.com/archive/index.php/t-84660.html "Set the default browser with Terminal or Applescript"), but the solution they are working out there is to open a specific URL with a specific application. I am looking for a way to set the default browser system wide. There's this neat app on GitHub, named [Objektiv](https://github.com/nthloop/Objektiv "nthloop/Objektiv · GitHub"), which does exactly what I am after, but it's an app. There's a Cocoa method, apparently, to set the NSWorkSpace default browser. 

The preference file `com.apple.LaunchServices` needs to be changed for this, maybe more.

How to set a different default browser via command line?

Thanks for help.