------------------------------------------------------------------------------- Hints and tips for Desktop handling Desktop Entry Specification http://standards.freedesktop.org/desktop-entry-spec/latest/ https://developer.gnome.org/integration-guide/stable/desktop-files.html.en Also see Basic Mime Type Handling .../info/misc/mime.txt Mail mime attachments .../info/mail/mail_attachements.txt Desktop Application files .../info/misc/desktop.txt Gnome Applications .../info/X/Gnome.hints ------------------------------------------------------------------------------- Desktop files describing applications and the mime types they handle .local/share/applications/*.desktop Files should be prefixed with #!/usr/bin/env xdg-open to make them executable. However this currently opens the file in a text editor, whcih many people see as a bug. Note "gnome-open" does the same thing, whole other 'open' programs execute it. This will also execute the desktop file (but can't be used as #! ) kioclient exec ------------------------------------------------------------------------------- Application opening The problem I have with these automatic applaction finding programs is that none of them work as I expect and there is little help in fixing or debugging issues. open-file # My personal one (generally selects one of the following) xdg-open # general but does not seem to always work gio open # from glib, and gtk 2.0 seems the newer default exo-open # xfce gvfs-open # gnome v3 -- no longer available gnome-open # gnome v2 -- no longer available mimeo ayr Others with custom configuration (typically regular expressions) linopen mmi-git aur-mirror The mimetype to application is generally stored in... .local/share/applications/mimeapps.list which will override the normal application specific mime lists Note mail programs generally use ".mailcap" to make it use some standard file opener, edit the file and add... */*; {open-file} "%s" To get the mime type, in general use... file -bi "file" --- xdg-open xdg-open is purely a shell script wrapper to try and find an appropriate application to view or execute the given file or URL, according to what applications are installed and running. https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html NOTE: gnome applications directly use "gio open" instead of "xdg-open" Get minetype of file xdg-mime query filetype {file} what will it do with that type - returns desktop filename xdg-mime query default {type} Change where it goes... xdg-mime default {desktop} {type...} Default Application xdg-mime default google-chrome.desktop text/html xdg-mime default brave-browser.desktop text/html This changes the file .config/mimeapps.list The xdg-open shell script is a wrapper around multiple file openers. But for URL's it falls back to using a $BROWSER environment variable. This is meant to set what the users default web browser is. If BROWSER is unset it defaults to trying "x-www-browser" and "firefox" amongst other things. "x-www-browser" is created by the a Debian "alternatives" system. As this is not normally a command, you get a "x-www-browser: command not found" error. See my "xdg-open" notes in... https://bugzilla.redhat.com/show_bug.cgi?id=755553#c9 and the 'standard web browser' selection in... https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=172436 ---- gio Mimetype of a file gio info file.html | grep ::fast-content-type: What to do with the type (default, registered, and recommended) gio mime text/html Change what is the default gio mime text/html firefox.desktop Open a file browser, on a HTML file -> menu -> preferences -> open_with This changes the binary file ".config/dconf/user" and ".config/mimeapps.list" Example... application/xhtml+xml=brave-browser.desktop For Torrents.. gio mime application/x-bittorrent qbittorrent.desktop gio mime x-scheme-handler/magnet qbittorrent.desktop --- Mimeo Python command line tool to "open" files based on MIME-type associations. It includes support for custom commands via argument regex matching. See http://xyne.archlinux.ca/projects/mimeo/ Goes with obfilebrowser http://xyne.archlinux.ca/projects/obfilebrowser/ An Openbox pipe menu application and file browser. ------------------------------------------------------------------------------- Icons for manels and menus What icons are available.. Use yad-icon-browser Personal icons in .local/share/icons (wine adds icons to hicolor) For Search order see .../info/misc/mime.txt How can I add / remove / order / list the various icon themes? At this time I see: Adwaita, gnome, hicolor EG: Lower priority of Adwaita Add Bluecurve ------------------------------------------------------------------------------- Thumbnail Generation Script Definitions .local/share/thumbnailers Gnome used to store thumbnails in... .cache/thumbnails Format: [Thumbnailer Entry] MimeType={list of file types it generates icons for} Exec=script %i %o Where... %i is the absolute path to the document being thumbnailed %o is the location to place the thumbnail This is the md5 hash of the 'file://' url stored in .thumbnails/normal/ See my personal script for generating thumbnails /home/anthony/bin/thumbnailers/generate The Old Gnome Nautilus Thumbnails were interfaced slightly differently See /home/anthony/bin/gnome_thumbnails -------------------------------------------------------------------------------