You are not logged in.
Hi,
I am about to create an AUR package for an application that I wrote. I want to define a dedicated mime type for some file types that this application processes and to set my application as default application for that mime type. The XML for the new mime type and the .desktop file for my application is part of the source code. I wold like to use xgd-utils.
My question: How and where do I do this in the PKGBUILD file?
Just for clarification: I know how to define a mime type and a default application in general.
Thanks and best regards,
mipi
Last edited by mipi (2018-01-03 09:38:51)
Offline
Just copy the xml file to /usr/share/mime/packages and the desktop file to /usr/share/applications. Nothing else is necessary since pacman already runs update-mime-database and update-desktop-database for you. If your application is the only one handling the mime type, it is already the default. If there are multiple applications for the mime type, then each user has to choose the default with e.g. "xdg-mime default" or some other tool. No package should change the default.
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Thanks!
Offline
If there are multiple applications for the mime type, then each user has to choose the default with e.g. "xdg-mime default" or some other tool. No package should change the default.
... And it is also worth noting that the system does have its own default, unless a user explicitly specifies an overridden per-user default using "xdg-mime default" or some such.
The system default is, unfortunately, chosen via RNG. And re-chosen every time update-desktop-database is run.
So users will have to select their own default, or it will randomly change every time any desktop file on your system is installed, updated, or removed.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
The system default is, unfortunately, chosen via RNG. And re-chosen every time update-desktop-database is run.
I'm thinking about creating a pacman hook that maintains an ordered /usr/share/applications/mimeapps.list for default applications, ordered by the pacman transaction and then alphabetical order of the desktop files.
A system-wide manual default can be set in /etc/xdg/mimeapps.list.
Last edited by progandy (2018-01-03 14:47:50)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Hmm, something that would operate in append-only mode to add new applications, while removing ones that have been removed from the system?
This really should be the desktop-file-utils default, IMO.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline