Forum › Forums › New users › New Users and General Questions › What does “Preferred Applications” do?
- This topic has 5 replies, 4 voices, and was last updated Jan 27-7:50 am by seaken64.
-
AuthorPosts
-
January 23, 2020 at 8:43 am #31923Member
Osmond
Hi there,
I assumed that the “Preferred Applications” thingamajig in the antiX Control Centre would allow to globally switch what application is used for certain types of files. But no, that is still done via the setting in the respective file managers and changing, e.g. the Text Editor to mousepad.desktop does not seem to have any effect. Textfiles are still opened with Geany unless I change that in Rox or Space. So… huh? Maybe I missed the explanation somewhere else but at least the FAQ page is a wee bit terse on the topic.
Thanks,
OsmondJanuary 23, 2020 at 1:27 pm #31941Anonymous
::Textfiles are still opened with Geany
MIME “OpenWith” filetype+handler associations are wildly configurable (can be customized//configured in different places) across applications. In a full-blown “desktop environment”, if ONLY using applications (text editor, etc.) for that environment, a fallback rule might specify a universally-recognizable default handler for a given mimetype… but we are not operating in that context. Instead, we have choice of rox (rox-filer), or spaceFM, or both, or XYZ, or none ~~ depending on antiX core / base / full edition and user-installed alternative applications.
the “Preferred Applications” thingamajig in the antiX Control Centre
Selections applied via the thingamajig are only consulted by the Control Centre when launching utilities, and the desktop-defaults-run command (called when launching certain items via the desktop menu)
Each time the antiX menu (or ControlCentre) launches “file manager” or “editor”
( or other handlers, see: ~/.local/share/desktop-defaults/* )
it needs to lookup which application has been set as the handler.rox-filer
to see its behind-the-scenes MIMEhandling associations, visit ~/.config/rox.sourceforge.net/MIMI-types/spaceFM
and the majority of desktop appliations you will encounter, utilize a xdg (aka freedesktop.org) lookup.
To understand that hairball, you might need to read, at a minimum:
man update-mime-database
man xdg-mime
man xdg-settings
man update-desktop-databaseexample usage:
xdg-mime default mirage.desktop image/jpegexample usage:
xdg-settings set default-web-browser firefox-esr.desktop
xdg-settings get default-web-browserhairball? —-v
https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.html configurable environment variables: $XDG_DATA_HOME: $HOME/.local/share $XDG_CONFIG_HOME: $HOME/.config $XDG_DATA_DIRS: default=none, appended to XDG_DATA_HOME $XDG_CONFIG_DIRS: default=none, appended to XDG_CONFIG_HOMEhttps://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-1.0.html path search order for mimeapps.list: $XDG_CONFIG_HOME/$desktop-mimeapps.list user overrides, desktop-specific (for advanced users) $XDG_CONFIG_HOME/mimeapps.list user overrides (recommended location for user configuration GUIs) $XDG_CONFIG_DIRS/$desktop-mimeapps.list sysadmin and ISV overrides, desktop-specific $XDG_CONFIG_DIRS/mimeapps.list sysadmin and ISV overrides $XDG_DATA_HOME/applications/$desktop-mimeapps.list for completeness, deprecated, desktop-specific $XDG_DATA_HOME/applications/mimeapps.list for compatibility, deprecated $XDG_DATA_DIRS/applications/$desktop-mimeapps.list distribution-provided defaults, desktop-specific $XDG_DATA_DIRS/applications/mimeapps.list distribution-provided defaultsInstead of invoking commandline “xdg-settings” and “xdg-mime” commands to deal with (manage) that hairball,
you can install the “galternatives” package and (AsRoot) launch its same-named GUI to choose, and rank, various handlers.
Whoops, it does not enable each individual user to customize their preferred handlers……and (so) the antiX “thingamajig” sidesteps that hairball and provides a configuration mechanism for its own use (for usage by individual users to select “preferred” handlers recognized by the antiX gui utilities).
January 23, 2020 at 1:40 pm #31944Anonymous
::Textfiles are still opened with Geany unless I change that in Rox or Space. So… huh?
freedom of choice
vs
opportunit(ies) for potential confusionEach of us may choose a different OpenWith handler (or none) for various mimetypes, separately, in a variety of contexts.
Instead of saying “huh?”, I welcome that freedom and, in many contexts, I do not want handling to be automagically performed (by a sole, predetermined, handler).
January 23, 2020 at 2:43 pm #31959MemberOsmond
::Thanks, skidoo!
I did not mean to insinuate that I dislike the freedom of choice with my “huh?”. Quite the opposite, I much prefer the “per context” choice. As it usually is on Linux anyway. But since that choice exists, I was wondering what “preferred applications” might be. It sounds like it might be an override but now that you spell it out, the model as it is in antiX makes sense. “If a (generic) Terminal is requested from the menu, then use this terminal” and so on.
Thanks for the resources and reading materials as well. I rarely use a file manager and had never used Rox or Space before but they actually seem pretty nice. Especially Rox really rocks.
Osmond
January 26, 2020 at 5:35 pm #32086Forum Admin
Dave
::@ skidoo, Does galternative do xdg mime types? I thought that was a frontend for update-alternatives…
@ everyone,
The preferred applications “thingamajig” should be updated. It also used to crudely modify the users mimeinfo.cache to make all mimetypes associated with the selected app (located in the .desktop file) to list the selected app first for eash item in the cache (which would make it preferred) but is now broke and outdated. (probably for the better) If galternatives does mime types that is great but I am not seeing it alter mime types only the debian alternatives system.As you say xdg-settings and xdg-mime are a bit of a hairball. They are alot more workable/usable now compared to when I last looked though I have not looked in detail….
The update-alternatives seems to work well. However IMHO it is hard to know what the program will do, hard to work with translations, hard to associate with the menu items, and very debian specific. From what I can see it works by altering a common name symlink (x-www-browser) to the selected binary file (/usr/bin/firefox). I feel there must be more to it, otherwise the system seems like a complicated way to simply make an alias by altering a symlink
Xfce with exo- stuff seems to be a little more clean. As best I can tell it holds a common named .desktop file (exo-web-browser.desktop) which runs a program (exo-open) which if passed a keyword (WebBrowser) it will first check for a match in ~/.config/xfce4/helpers.rc (which holds a keyword=binary format) for a match then fall back on mime types (which may be xdg-open). This enables a generic/recognizable name with translation, tells what the program will do (albeit generically), and associatable with the menu/apps. Works great for the four items of, email, terminal, web browser, file manager. That is as long as everything calls exo-open.
The preferred applications “thingamajig” largely does the same as update-alternatives by using a common named .desktop file (web-browser.desktop) which is a symlink to an user selected .desktop (firefox-esr.desktop). I think this has a menu item duplication side effect though, also not the best way to do things and by no means clean… I was thinking to update it to change the .desktop files currently used as symlinks and instead have them remain generic .desktop files (similar to xfce) with the exec line pointing to custom listings in the update-alternatives system. (This makes it very debian dependent though so maybe just some symlinks of the same name in the path.) Then have a second tab for the xdg stuff to review/alter mime types from ~/.config/mimeapps.list with the option to add lines from /usr/share/applications/mimeinfo.cache. Then I do not need to wade into automatically altering the mimeapps.list again and if you would like your “preffered applications” selections to also work in the xdg mime world you could alter the mimetypes to point to the generic “preferred applications” desktop files.
Any other input / thoughts?
Computers are like air conditioners. They work fine until you start opening Windows. ~Author Unknown
January 27, 2020 at 7:50 am #32119Memberseaken64
::This is a fascinating subject. I’m learning a lot.
But, from my point of view, this is one of the “habits” that we have learned from GUI managed systems that tend to use up resources on our computers. For most this doesn’t matter because they have plenty of resources to work with. But when I am on a limited system I appreciate the way antiX does not include all the user-friendly options possibly available. I learn to open files with the appropriate program on my own. And I usually open the program first or add the filename at time of execution. And I use right-click if I want to choose from a list.
I am not suggesting that my way is better. Only that I appreciate that antiX gives me the choice without taking up my resources by default.
Seaken64
-
AuthorPosts
- You must be logged in to reply to this topic.