[PATCH] desktop environment specific defaults.list
@stanislav-brabec
Submitted by Stanislav Brabec Link to original bug (#630171)
Description
Created attachment 170669 glib-mime-env-specific-defaults.patch
In the current GIO implementation, only one defaults.list can be used.
It makes impossible to have different defaults for GIO-based applications in KDE and GNOME.
Attached patch makes possible to use desktop environment specific defaults.list files.
Dependencies: GIO: gdesktopappinfo.c: improvement of MIME caching code must be applied before this patch bug 596192
desktop-file-utils: smart defaults per MIME heuristic https://bugs.freedesktop.org/show_bug.cgi?id=30214
How to test:
- Install upper mentioned patches together with this one.
- update-desktop-database --defaults-list
ssh -X localhost 3.1 DESKTOP_SESSION=kde nautilus --no-desktop nautilus will prefer KDE applications. 3.2 DESKTOP_SESSION=gnome nautilus --no-desktop nautilus will prefer GNOME applications.
Discussion:
Patch now uses $XDG_DESKTOP_PREFIX (in form "foo-" with trailing hyphen), if it is not set, then $DESKTOP_SESSION (in form "desktop" without trailing hyphen)
Other possibilities to switch betweens desktops: Implement something like g_desktop_app_info_set_env() or use g_desktop_app_info_set_desktop_env() (It has now a bit different meaning.)
Note that it seems that nautilus have a custom way to select defaults as well.
See also discussion in https://bugs.freedesktop.org/show_bug.cgi?id=30214
Patch 170669, "glib-mime-env-specific-defaults.patch":
glib-mime-env-specific-defaults.patch