Idea about generic command framework for launching common applications

Darren Fulton dfulton at
Mon Nov 17 21:02:22 PST 2008

Very interesting.   Thank you.  If I just wanted to open a text editor 
[this is just an example], so that I could type up a quick note, I would 
[I don't know what anyone else would do] open a text editor, type stuff 
(maybe print it if necessary), then probably click File, click Save, 
decide where to save it, and what to name it. 

I'm providing a simple and uniform way that might allow a computer user 
to get a text editor, or a web browser, or an email client, or a word 
processor, or any other very common application, open lickety-split on 
whatever desktop environment that he may be in front of him at that 
moment.  It isn't directly about mime-types or about opening existing 
files.  It is about getting a useful program open so that he can get 
stuff done.  This isn't taking anything away from the user.  It is 
adding a new, useful, option for computer users to launch applications.

If I were on a Windows PC on somebody's network somewhere, I could with 
confidence, click Start, Run, type notepad.exe and click the Ok button.  
A graphical text editor would open.  In Linux, with our many different 
distributions, our multiple desktop environments, and the enormous 
variety of included and optional applications, I'm not able to get that 
program open so easily.  I won't even know immediately whether firefox, 
or gedit, or kwrite, or any particular graphic application is 
installed.  By aliasing a generic command to an installed graphical 
application, that problem goes away.  Add in the bonus benefit of those 
commands being configurable (system wide and also by individual users) 
you end up with something that is very simple and very useful in my 
opinion.  Please chime in and let me know if you agree or not.  Thank you.

Thank You,

Darren Fulton

François Revol wrote:
> For what it's worth, here is how it's done in BeOS and Haiku.
> Each application has a mime signature.
> For example, the default image viewer in BeOS, ShowImage has the type:
> application/x-vnd.Be-ShowImage
> Each application also exports a resource (that is copied to an xattr) 
> describing the mime types it supports. 
> shows this with the pretty names (text being the supertype, and "Text 
> File" being text/plain).
> The mime database has a preferred handler set by either its mime type 
> or its path, which can be overridden for each file by setting an xattr:
> Then it becomes quite easy to open the default application for a mime 
> type, or force using another one.
> In Haiku one can do
> open application/ foo.txt
> to force openning foo.txt with the Programmer Editor instead of the 
> default app (StyledEdit), regardless of where it is installed (the 
> system runs a query on the BEOS:APP_SIG xattr).
> The setmime command provides CLI access to the mime db, for ex:
> $ setmime -dump text/html
> /bin/setmime -set text/html -short "HTML File" -preferredAppSig 
> application/x-vnd.Firefox -sniffRule '0.40          [0:64]( -i "<HTML" 
> | "<HEAD" | "<TITLE" | "<BODY" | "<TABLE" | "<!--" | "<META" | "<
> CENTER")' -extension htm -extension html
> (it doesn't dump icon hex data by default)
> We also use a mime type to specify url handlers:
> $ setmime -dump application/x-vnd.Be.URL.http
> /bin/setmime -set application/x-vnd.Be.URL.http -preferredAppSig 
> application/x-vnd.Firefox
> And a simple
> /bin/setmime -set application/x-vnd.Be.URL.http -preferredAppSig 
> application/x-vnd.NetSurf
> /bin/setmime -set text/html -preferredAppSig application/x-vnd.NetSurf
> would make NetSurf the default browser
> The only lack would be differentiation between viewing and editting, 
> though there is provision for it in the API, but currently B_OPEN is 
> the only defined verb.
> François.
> _______________________________________________
> xdg mailing list
> xdg at

More information about the xdg mailing list