Results 1 to 7 of 7

Thread: Stop GNOME changing default application for file type.

  1. #1

    Default Stop GNOME changing default application for file type.

    • Double click any JPEG in Nautilus and it opens in GNOME Image Viewer.
    • Right click a JPEG in Nautilus select "Open With Another Application".
    • Select GIMP. JPEG is opened in GIMP.
    • Close GIMP.
    • Double click any JPEG in Nautilus and it opens in GIMP.
    • Say swear words. Just because I opened one JPEG In GIMP one time doesn't mean I now want all JPEGS to open in GIMP by default.


    How do I stop the above happening? The behaviour occurs with a newly created user. This annoying behaviour doesn't happen in Fedora and I can't find anyone else talking about. I'm wondering if it's an openSUSE specific thing.

  2. #2
    Join Date
    Oct 2014
    Location
    Italy
    Posts
    1,674

    Default Re: Stop GNOME changing default application for file type.

    A quick test confirmed that SLED12 SP3 and Ubuntu 16.10, both with Gnome, behave the way you expect.
    So there seem to be something unique to Leap, even 42.2, but I'm nor smart enough to find out.
    Main: Leap 15 Gnome on i7 4720HQ + Geforce GTX960M
    Test: Leap 42.3 (& others) on Core2Duo + GM965

  3. #3
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,822
    Blog Entries
    15

    Default Re: Stop GNOME changing default application for file type.

    Hi
    If you go into System Settings -> Details and set the 'Default Application' for Photos it should stay at eg Shotwell Viewer even when you open an individual item with another application.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  4. #4
    Join Date
    Oct 2014
    Location
    Italy
    Posts
    1,674

    Default Re: Stop GNOME changing default application for file type.

    Good tip Malcolm, but odd behaviour anyway.
    Default app for photos already was "Image Viewer", but it didn't stick. Changed that to "GIMP", then back to "Image Viewer" and now it does stick.
    I guess, unless you explicitly choose one application as default the system just picks the first "recommended application" but doesn't consider it as "default" actually?
    And SLED doesn't need that trick as far as I witnessed here.
    Main: Leap 15 Gnome on i7 4720HQ + Geforce GTX960M
    Test: Leap 42.3 (& others) on Core2Duo + GM965

  5. #5
    Join Date
    Oct 2014
    Location
    Italy
    Posts
    1,674

    Default Re: Stop GNOME changing default application for file type.

    A few more tests shed some light on the matter...
    Created a fresh user. The file ~/.config/mimeapps.list does NOT exist.
    Opening a .jpeg file, the first app in alphabetical order is offered (in my case, Darktable) but since mimeapps.list does not exist, this is not actually a "default app" for jpeg.
    Choosing another app to open the .jpeg (say, eog AKA "Image Viewer") creates a mimeapps.list file BUT its content is as follows:
    Code:
    [Added Associations]
    image/jpeg=eog.desktop;
    So, since eog.desktop is now an "added association", "Image Viewer" is now called upon "double click" on a .jpeg file. But please note, there is NO "[Default Applications]" section yet, so "Image Viewer" is NOT a default yet and so doesn't stick.
    When you follow Malcolm's advice or select a .jpeg file, CTRL+I, "Open With" tab, select GIMP (say) and "Set as default", then select "Image Viewer" and "Set as default" again, now you see in mimeapps.list:
    Code:
    ...
    [Default Applications]
    image/jpg=eog.desktop
    Now "Image Viewer" is indeed THE default application and will stick as such until explicitly set otherwise.

    Maybe other distros (including SLED apparently) have another way to set sensible defaults even when the user mimeapps.list doesn't explicitly list them as such.
    Main: Leap 15 Gnome on i7 4720HQ + Geforce GTX960M
    Test: Leap 42.3 (& others) on Core2Duo + GM965

  6. #6

    Default Re: Stop GNOME changing default application for file type.

    The annoying behaviour is gone!

    Thank you both, for the method of the fix and the detail. I'm told I "must spread some Reputation around" before giving it to either of you again else I would do that.

  7. #7
    Join Date
    Oct 2014
    Location
    Italy
    Posts
    1,674

    Default Re: Stop GNOME changing default application for file type.

    As I said, I'm not smart enough, but I keep trying
    According to Gnome docs https://help.gnome.org/admin/system-...cation.html.en system-wide default apps are defined by one of the following two files:
    /usr/share/applications/defaults.list
    /usr/share/applications/mimeapps.list

    I find the first one in my test Ubuntu 16.10 and that may explain while there the default apps behave as expected even if a single user didn't set them explicitly.
    I find no such files in various (open)SUSE installs I have at the moment, but... there is a:
    /usr/share/applications/gnome-mimeapps.list
    in openSUSE Leap42.2, SLED12 SP3, Tumbleweed-Gnome (actually checked an old 20170322 snapshot with Gnome 3.24).
    Apparently, that file does its job in SLED and Tumbleweed, but not so in Leap 42.2 (nor 42.3 according to the OP). Is that file not parsed in Leap?

    So what we suggested in this thread is a workaround, but there is definitely something wrong in Leap.
    I'll join in testing if somebody is interested enough to file and follow up a bug report.
    Main: Leap 15 Gnome on i7 4720HQ + Geforce GTX960M
    Test: Leap 42.3 (& others) on Core2Duo + GM965

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •