2022-05-01 19:29:55 +00:00
|
|
|
---
|
|
|
|
title: "Default Programs"
|
|
|
|
tags: [ "Documentation", "Defaults", "Mime Type" ]
|
|
|
|
---
|
|
|
|
|
2022-11-06 13:28:09 +00:00
|
|
|
Install the package `xdg-utils`, then make very liberal use of the tab button.
|
2022-05-01 19:29:55 +00:00
|
|
|
|
|
|
|
## Ask
|
|
|
|
|
|
|
|
Ask what type of application opens an mkv file:
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
xdg-mime query default video/mkv
|
|
|
|
```
|
2022-05-01 19:29:55 +00:00
|
|
|
|
|
|
|
Same with pdf:
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
xdg-mime query default application/pdf
|
|
|
|
```
|
2022-05-01 19:29:55 +00:00
|
|
|
|
2022-08-19 11:27:27 +00:00
|
|
|
Ask what file-type `book.pdf` uses.
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
xdg-mime query filetype *book.pdf*
|
|
|
|
```
|
2022-08-19 11:27:27 +00:00
|
|
|
|
2022-05-01 19:29:55 +00:00
|
|
|
## Set
|
|
|
|
|
|
|
|
Set the mime type of mp4 videos to mpv.
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
xdg-mime default mpv.desktop video/mp4
|
|
|
|
```
|
2022-05-01 19:29:55 +00:00
|
|
|
|
2022-08-19 11:27:27 +00:00
|
|
|
You'll need to use the tab key a lot here, and remember many items start with `org`.
|
|
|
|
|
|
|
|
You can use an asterisk for everything in a category.
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
xdg-mime default org.gnome.font-viewer.desktop font/\*
|
|
|
|
```
|
2022-05-01 19:29:55 +00:00
|
|
|
|
2022-08-19 11:27:27 +00:00
|
|
|
This often won't work as expected, because some fonts will have the type `application` rather than `font`.
|
2022-05-01 19:29:55 +00:00
|
|
|
|