Results 1 to 5 of 5

Thread: Ubuntu 24.04 - How do I change the file-application association?

  1. #1
    Join Date
    Jun 2022
    Beans
    6

    Ubuntu 24.04 - How do I change the file-application association?

    Previously it was possible to do this within nautilus by selecting file properties, "Open with...". Now I can't find a way doing this. I've checked in the "Settings" app. There's a "Default Apps" section but it only shows generic associations rather by than file extension. What's the current way of changing the file association?

    My specific problem is that I would like to open .csv file with a specific application, unfortunately, whenever I double click it will open LibreOffice Calc which is not the app I want to use for these files. So every time I have to click "open with other application" then click on the application I want to use, but I can't see any option to set the selected app as "default".

  2. #2
    Join Date
    Dec 2014
    Beans
    2,721

    Re: Ubuntu 24.04 - How do I change the file-application association?

    The tool 'xdg-mime' on the command line should allow you to do that. Use 'xdg-mime query filetype path/and/name-of-the-file' (replace the obvious placeholder ...) to get the exact name of the mime-type of the file then use 'xdg-mime default name-of-the-desktop-file mime-type' to set the program for which you give the name of the desktop file as the default for that mime-type.

    Holger

  3. #3
    Join Date
    Dec 2024
    Beans
    2

    Re: Ubuntu 24.04 - How do I change the file-application association?

    Is there a way to find out the application currently associated with a mime type? xdg-mime does not do it. Where are configs (eg conig text file) held?

  4. #4
    Join Date
    Dec 2024
    Beans
    2

    Re: Ubuntu 24.04 - How do I change the file-application association?

    It seems to be listed in .config/mimeapps.list The applications are identified by their .desktop file (ie in /usr/share/applications )

    eg

    application/pdf=libreoffice-draw.desktop;org.gnome.gedit.desktop;org.gnome.Evi nce.desktop;



    The default one for pdf (ie when you double-click on it) is: evince – gnome document viewer (built-in). Another file must determine that this be used?

  5. #5
    Join Date
    Jun 2022
    Beans
    6

    Re: Ubuntu 24.04 - How do I change the file-application association?

    The help of xdg-mime isn't very helpful but you can actually do something like:

    Code:
    xdg-mime query default text/csv

Tags for this Thread

Bookmarks

Posting Permissions

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