updated README
This commit is contained in:
parent
265a1b9b95
commit
da348f82f2
53
README.md
53
README.md
@ -1,5 +1,3 @@
|
|||||||
# xdg-sanity
|
|
||||||
|
|
||||||
The `xdg-sanity` script is built to replace your default web browser in your
|
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
|
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
|
`xdg-open` and sends it to the appropriate application. For example, it will
|
||||||
@ -16,51 +14,31 @@ AUR](https://aur.archlinux.org/packages/xdg-sanity).
|
|||||||
|
|
||||||
Dependencies:
|
Dependencies:
|
||||||
- `curl(1)`
|
- `curl(1)`
|
||||||
- `xdg-utils(1)` or `handlr(1)`
|
- `handlr(1)`
|
||||||
- `tomcat(1)`
|
- [`tomcat(1)`](https://git.tebibyte.media/emma/tomcat) (optional; enables
|
||||||
|
[extensions](#extensions))
|
||||||
You can get `tomcat` [here](https://git.tebibyte.media/emma/tomcat)
|
|
||||||
|
|
||||||
Instructions:
|
Instructions:
|
||||||
Clone this repository and move the `xdg-sanity` binary wherever your operating
|
Clone this repository and move the `xdg-sanity` binary wherever your operating
|
||||||
system stores locally-installed binaries. This is usually `/usr/local/bin` or
|
system stores locally-installed binaries. This is usually `/usr/local/bin/` or
|
||||||
`$HOME/.local/bin` for your user. Make sure the installation location is in your
|
`"$HOME/.local/bin/"` for your user. Make sure the installation location is in
|
||||||
`$PATH`.
|
your `$PATH`.
|
||||||
|
|
||||||
Create an `xdg-sanity.desktop` file either manually or with `gendesk(1)`,
|
Create an `xdg-sanity.desktop` file, placing it where your OS stores
|
||||||
placing it where your OS stores locally-installed `.desktop` files, which is
|
locally-installed `.desktop` files, which is usually
|
||||||
usually `/usr/local/share/applications` or `$XDG_DATA_HOME/applications` for
|
`/usr/local/share/applications` or `$XDG_DATA_HOME/applications` for your user.
|
||||||
your user. Set your default web browser to that `.desktop` file with
|
Set your default web browser to that `.desktop` file using `handlr set`.
|
||||||
`xdg-settings(1)` or an equivalent.
|
|
||||||
|
|
||||||
### Configuration
|
|
||||||
|
|
||||||
This program uses [TOML](https://toml.io/en/v1.0.0) for its configuration. The
|
|
||||||
configuration file is set up like this:
|
|
||||||
```
|
|
||||||
$ cat $XDG_CONFIG_HOME/xdg-sanity.toml
|
|
||||||
[tools]
|
|
||||||
browser = "firefox"
|
|
||||||
xdg = "handlr launch"
|
|
||||||
```
|
|
||||||
|
|
||||||
The options available for `xdg` are `handlr launch` if you use `handlr(1)` and
|
|
||||||
`xdg-open` if you use `xdg-utils(1)`.
|
|
||||||
|
|
||||||
### Usage
|
|
||||||
|
|
||||||
`xdg-sanity [RESOURCE]`
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
#### Extensions
|
#### Extensions
|
||||||
|
|
||||||
Extensions are written using TOML and are stored in either
|
Extensions are written using TOML and are stored in either
|
||||||
`/usr/share/xdg-sanity` when installed from a package manager,
|
`/usr/share/xdg-sanity` when installed from a package manager,
|
||||||
`/usr/local/share/xdg-sanity` when installed locally, or
|
`/usr/local/share/xdg-sanity` when installed locally, or
|
||||||
`$XDG_DATA_HOME/xdg-sanity` for your user.
|
`$XDG_DATA_HOME/xdg-sanity` for your user.
|
||||||
|
|
||||||
|
Extension support requires the installation of the `tomcat(1)` tool, which
|
||||||
|
parses TOML for the command line.
|
||||||
|
|
||||||
There are two types of extensions: MIME and replace. MIME extensions are parsed
|
There are two types of extensions: MIME and replace. MIME extensions are parsed
|
||||||
first and replace the MIME type of the content being fetched. Replace extensions
|
first and replace the MIME type of the content being fetched. Replace extensions
|
||||||
change the URI passed to the command to another.
|
change the URI passed to the command to another.
|
||||||
@ -86,3 +64,4 @@ urls = [ "youtube.com", "youtu.be" ]
|
|||||||
|
|
||||||
[with]
|
[with]
|
||||||
url = "https://piped.mint.lgbt/"
|
url = "https://piped.mint.lgbt/"
|
||||||
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user