1

I decided to use a midi controller for certain tasks, so I've used midi2input for this.

The application compiled with no errors however, when I click on the icon I get:

Invalid desktop entry file: '~/.local/share/applications/m2i.desktop

These are the contents of the desktop entry:

[Desktop Entry] 
Encoding=UTF-8 
Version=1.0 
Type=Application 
Terminal=true 
Exec=/usr/local/bin/ 
Name=Midi2Input 
Icon=/home/emm/midi2input/build/res/icons/hicolor/512x512/apps/m2i-light.png

Any ideas?

The png exists. I've also just altered the Exec line as you suggested and I've also re-built it and it's still giving the same error.


Current desktop entry:

[Desktop Entry]  
Encoding=UTF-8  
Version=1.0  
Type=Application  
Terminal=false  
Exec=/usr/local/bin/m2i  
Name=midi2input  
DBusActivatable=false  
Icon=/home/emm/midi2input/build/res/icons/hicolor/512x512/apps/m2i-light.png  
StartupNotify=true  
emm@i3:~$ ls -al /usr/local/bin/m2i
-rwxr-xr-x 1 root root 606864 Jul 21 12:28 /usr/local/bin/m2i
emm@i3:~$ ls -al /home/emm/midi2input/build/res/icons/hicolor/512x512/apps/m2i-light.png
-rw-rw-r-- 1 emm emm 10010 Jul 22 08:05 /home/emm/midi2input/build/res/icons/hicolor/512x512/apps/m2i-light.png
emm@i3:~$
8
  • Does that file exist? If so please share the contents? Commented Jul 21, 2020 at 12:40
  • It didn't until I created it. Here's the contents:[Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Terminal=true Exec=/usr/local/bin/ Name=Midi2Input Icon=/home/emm/midi2input/build/res/icons/hicolor/512x512/apps/m2i-light.png Commented Jul 21, 2020 at 12:42
  • 1
    Looking at the following it looks like your Exec line is wrong (it should point to the executable, not just a folder): developer.gnome.org/desktop-entry-spec Also: Does the png file exist? What happens if you re-build & try again? Commented Jul 21, 2020 at 12:48
  • 1
    Add information essential to solve your question to the question, d not leave into the comments. Use "edit" to edit your question. Commented Jul 21, 2020 at 13:03
  • Related: How do I create a valid shortcut for Eclipse? Commented Jul 21, 2020 at 13:34

2 Answers 2

2

You have not specified the full path of the executable.

You have only put:

Exec=/usr/local/bin/

See the documentation on Desktop Entry Specification - GNOME Developer

Exec

Program to execute, possibly with arguments. See the Exec key for details on how this key works. The Exec key is required if DBusActivatable is not set to true. Even if DBusActivatable is true, Exec should be specified for compatibility with implementations that do not understand DBusActivatable.

Not to be confused with:

Name

Specific name of the application, for example "Mozilla".

1
0

Try making sure you are launching the .desktop file you think. Use locate m2i.desktop (1) to see if there is more than one such file in your system (I am assuming you have an updated mlocate database).

Then if you are sure the Exec file pointed at is correct, comment lines in the .desktop files and try launching m2i, until you identify the culprit. You could use gtk-launch m2i (2), see this. You could comment one by one, comment them in bunches (sort of a bisection method), or comment all except for the Exec and only one more. This last form is probably the best.

Please post feedback on commands (1) and (2a), (2b), etc. (one for each line that was left uncommented), and the output of

ls -al /usr/local/bin/m2i
ls -al /home/emm/midi2input/build/res/icons/hicolor/512x512/apps/m2i-light.png
type m2i

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.