A spec to set default terminal applications?

Vladimir Kudrya vladimir-csp at yandex.ru
Thu Aug 30 07:35:56 UTC 2018


Couple of notes.

xdg-terminal-exec in its current form is a minimum intervention 
solution: you need to place desktop files for some terminals, then use 
xdg-terminal-exec itself as a command to launch terminal.

ArgPrefix has a solid generic use case: there was a bug in Ocrfeeder: 
https://bugzilla.gnome.org/show_bug.cgi?id=767732 It required an 
argument to open file, but no argument to just launch the app. Current 
desktop entry spec can not handle this via single desktop entry.


I'll try to sum up, simplify, and build upon Jan's and Ian's proposals.

Fields for destop entries:
MimeType: what app can open
MimeTypeView: what app can open for viewing
MimeTypeEdit: what app can open for edit
Intent: what actions app represents (analogous to MimeType, like: 
x-intent/terminal, x-intent/increase-brightness.) Choosing goes 
alongside mimetypes and schemes into mimeapps.list hierarchy.
ArgPrefix: argument(s) to be added to the beginning of command line if 
there are other arguments provided.

With all above:
xdg-open some.file: current behavior
xdg-open --edit some.file: uses MimeTypeEdit choices.
xdg-open --view some.file: uses MimeTypeView choices.
xdg-intent terminal: opens terminal.
xdg-intent termianl foo --bar: runs foo --bar in chosen terminal, using 
ArgPrefix if needed. IMHO one of the few intents that would ever require 
arguments.

This strategy is backward-compatible, uses same data and config 
hierarchies, works without dbus (I don't want to touch it even with ten 
meter stick), 'xdg-intent terminal' can be used as drop in for terminal 
emulators. (xdg-terminal as wrapper to get rid of that space?).


More information about the xdg mailing list