A tool to help my sanity when opening http/s links.
Go to file
2022-11-08 01:17:06 -05:00
example-extensions rewrite all in one commit lol 2022-11-08 01:05:10 -05:00
LICENSE initial commit 2022-09-01 22:17:23 -04:00
README.md oops 2022-11-08 01:17:06 -05:00
xdg-sanity rewrite all in one commit lol 2022-11-08 01:05:10 -05:00
xdg-sanity.sh added redirect handling 2022-09-05 21:33:31 -04:00

xdg-sanity

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 send image/jpeg MIME type files to your image viewer.

Installation

Arch Linux

I maintain a package on the AUR.

From Source

First, make sure you have curl(1), xdg-utils(1) (or an alternative like handlr), and tomcat installed. Then, clone this repository and move the xdg-sanity binary wherever your operating 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 $PATH.

Create an xdg-sanity.desktop file either manually or with gendesk(1), placing it, also, where your OS stores locally-installed .desktop files, usually /usr/local/applications. Set your default web browser to that .desktop file with xdg-settings(1) or an equivalent.

Add your default web browser to $XDG_CONFIG_HOME/xdg-sanity.toml so the script can forward links to it.

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.