2022-09-02 06:42:26 +00:00
|
|
|
# xdg-sanity
|
|
|
|
|
2022-09-08 02:06:14 +00:00
|
|
|
The `xdg-sanity` script is built to replace your default web browser in your
|
|
|
|
desktop/XDG settings. It intercepts http/s URIs sent to the default browser by
|
|
|
|
`xdg-open` and sends it to the appropriate application. For example, it will
|
2022-09-22 02:03:02 +00:00
|
|
|
send `image/jpeg` MIME type files to your image viewer.
|
2022-09-02 06:42:26 +00:00
|
|
|
|
2022-09-08 02:06:14 +00:00
|
|
|
## Installation
|
|
|
|
|
|
|
|
### Arch
|
|
|
|
|
|
|
|
I maintain a package [on the
|
|
|
|
AUR](https://aur.archlinux.org/packages/xdg-sanity).
|
|
|
|
|
|
|
|
### From Source
|
|
|
|
|
2022-09-22 02:03:02 +00:00
|
|
|
First, make sure you have `curl(1)` and `handlr(1)` installed. Then, clone this
|
2022-09-08 02:06:14 +00:00
|
|
|
repository and move the `xdg-sanity/` folder into `/etc` and `xdg-sanity.sh` to
|
|
|
|
`xdg-sanity` wherever your operating system stores locally-installed binaries.
|
2022-09-22 02:03:02 +00:00
|
|
|
This is usually `/usr/local/bin`. Make sure the installation location is in your
|
|
|
|
`$PATH`.
|
2022-09-08 02:06:14 +00:00
|
|
|
|
2022-09-22 02:03:02 +00:00
|
|
|
Create a `xdg-sanity.desktop` file either manually or with `gendesk(1)`,
|
2022-09-08 02:06:14 +00:00
|
|
|
placing it, also, where your OS stores locally-installed `.desktop` files,
|
2022-09-22 02:03:02 +00:00
|
|
|
usually `/usr/local/applications`. Set your default web browser to that
|
2022-09-08 02:06:14 +00:00
|
|
|
`.desktop` file.
|
|
|
|
|
2022-09-22 02:03:02 +00:00
|
|
|
Add your default web browser to `/etc/xdg-sanity/xdg-sanity.conf` so the
|
|
|
|
script can forward links to it.
|
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
|
|
|
Open links from applications outside your web browser as normal. Alternatively,
|
|
|
|
you can call `xdg-sanity` directly with the only argument accepted being a URI.
|