LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Problem setting default application for Audio CD in Gnome 3 (https://www.linuxquestions.org/questions/linux-desktop-74/problem-setting-default-application-for-audio-cd-in-gnome-3-a-4175624988/)

Beryllos 03-05-2018 12:08 PM

Problem setting default application for Audio CD in Gnome 3
 
Objective: When I insert an audio CD in the drive, I want the system to automatically start a CD ripper of my choosing (ripper called abcde).

Already tried: I have successfully set up a desktop-accessible application by creating the file /usr/share/applications/abcde.desktop which is visible in the desktop GUI and works correctly when I click on the desktop icon.

Problem: The new application does not appear in the list of applications which may be chosen under System Settings...Details...Removable Media (Select how media should be handled)...CD audio. Therefore I cannot select the new application as the default application for removable media of the Audio CD type.

ondoho 03-06-2018 01:03 AM

Quote:

Originally Posted by Beryllos (Post 5827573)
Problem: The new application does not appear in the list of applications which may be chosen under System Settings...Details...Removable Media (Select how media should be handled)...CD audio. Therefore I cannot select the new application as the default application for removable media of the Audio CD type.

must have something to do with mimetypes and/or categories defined inside the .desktop file.
i suggest you look at one from an app that DOES show up, and copy these settings to your abcde.desktop.

Beryllos 03-07-2018 07:59 AM

Problem solved. Thank you for your help.

The problem was not due to the MimeType or Categories lines, which I had copied from another application to begin with. However, your suggestion encouraged me to look for other differences.

Eventually I found the problem in the Exec line. I have configured abcde so that it requires no arguments, but the application will not appear in the selection list unless a filename or device argument is provided. Here is the solution:

Before (application not visible in the selection list):
Code:

Exec=/usr/bin/abcde
After (application visible, selectable, works fine):
Code:

Exec=/usr/bin/abcde %f
or
Code:

Exec=/usr/bin/abcde %u
Given my abcde configuration, the argument is ignored, and the program executes correctly.

Edit: One more detail: In order to make the selection persist beyond the current desktop login session, the new application must be added to the user's mimeapps.list, in its [Default Applications] section.

On my system, this is located at ~/.local/share/applications/mimeapps.list. However, I read that on some systems it may be found instead at ~/.config/mimeapps.list.


Code:

[Default Applications]
...
x-content/audio-cdda=abcde.desktop



All times are GMT -5. The time now is 06:39 AM.