m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/xdg-open.md
diff options
context:
space:
mode:
Diffstat (limited to 'xdg-open.md')
-rw-r--r--xdg-open.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/xdg-open.md b/xdg-open.md
new file mode 100644
index 0000000..a688517
--- /dev/null
+++ b/xdg-open.md
@@ -0,0 +1,30 @@
+# Opening files with specific programs
+
+`xdg-open` looks up a file's mimetype, then determines which application to use
+to open it.
+
+The local database for applications to use is in `~/.config/mimeapps.list`. Need
+a `.desktop` file, which can be created under `~/.local/share/applications/`.
+
+## Setting defaults
+
+Easiest to do with `mimeopen` (from `perl-file-mimeinfo` on Arch):
+
+ mimeopen -d <file>
+ # will prompt to select a program from a list
+
+## Default browser
+
+The relevant mime types are:
+
+ x-scheme-handler/http=
+ x-scheme-handler/https=
+
+For qutebrowser, just copied the `.desktop` from [the repo](https://github.com/qutebrowser/qutebrowser/blob/master/misc/org.qutebrowser.qutebrowser.desktop).
+
+## `ranger`
+
+`ranger` uses its own launcher, `rifle`. Copy the default config to
+`~/.config/ranger/rifle.conf`:
+
+ ranger --copy-config=rifle