Skip to content

Commit

Permalink
Nicer README with better install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
specious committed Dec 20, 2017
1 parent 3723977 commit 6d5bfd3
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,38 @@
defaultbrowser
==============

Command line script for getting and setting a default browser (HTTP handler) in Mac OS X.

As there seems no other elegant way of doing it you need some Objective-C code.

The code uses Launch Services. More info on
[Launch Services Reference](https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/Reference/reference.html)
Command line tool for setting the default browser (HTTP handler) in macOS X.

Install
-------

Build
-----
1. Build it.
Build it:

```
cd defaultbrowser
xcodebuild -project defaultbrowser.xcodeproj -alltargets -configuration Release
```

2. Move it into your path (replace ~/bin to whatever you like)
Move it into your executable path:

```
cp build/Release/defaultbrowser ~/bin/
cp build/Release/defaultbrowser /usr/local/bin/
```

Usage
-----

Open the XCode project and build it or download the build/defaultbrowser and put it somewhere
in your path. `chmod +x defaultbrowser` is probably also necessary.

You can set the default browser with:
Set the default browser with:

```
defaultbrowser -set chrome
```

Running defaultbrowser without arguments shows the current setting.
Running `defaultbrowser` without arguments shows the current setting.

How does it work?
-----------------

The code uses the [macOS Launch Services API](https://developer.apple.com/documentation/coreservices/launch_services).

License
-------
Expand Down

0 comments on commit 6d5bfd3

Please sign in to comment.