5

I've created a .desktop file.

[Desktop Entry]
Exec=cd /opt/sqldeveloper/sqldeveloper/bin && bash sqldeveloper $*
Terminal=false
StartupNotify=true
Categories=GNOME;Oracle;Utility;Development;
Type=Application
Icon=/opt/sqldeveloper/icon.png
Name=Oracle SQL Developer
Comment=what to say
Version=s.0.m.t.h.i.n.g
GenericName=ORACLE SQL DEVELOPER

It is present in /usr/share/applications .It is even showing the icon if viewed in Nautilus, but when I press alt (the dash or windows key) and search for it, it is not visible.

Also I tried:

sudo update-desktop-database
12
  • Could you post the contents of the .desktop file? (and I think you mean the Windows -key?) – Jacob Vlijm Sep 20 '14 at 11:32
  • yeah, right, the windows key. – Gokul Sep 22 '14 at 15:48
  • Have you (at least) tried relog? The "Version" string is very uncommon - might be an issue. AFAIK the bash commands should be placed between quotation marks. – Roomy Sep 22 '14 at 15:55
  • There is a number of issues with your command, using it like that in a .desktop file. Change it and it is ok. I tried your file with another (working) command, then it works fine. I'll anwer it when it is reopened. – Jacob Vlijm Sep 22 '14 at 16:06
  • 1
    1) version should be 2 numbers 1.0 for ex 2) your Exec is wierd, how about bash /opt/sqldeveloper/sqldeveloper/bin/sqldeveloper $* ? (not sure that you can use a wildcard like * in your exec line though) 3) GenericName is the same as Name ? There's no point in that... remove GenericName entry if you're gonna use the same string 4) Is the icon valid ? If the icon doesn't exist, it will most likely never be displayed in Dash 5) Oracle isn't a recognized Category, you should read freedesktop's documentation for more information – MrVaykadji Sep 22 '14 at 16:31
5

What is the critical issue in your .desktop file

I tried your .desktop file replacing the Exec= command with another (simple and working) one and the file appears to be functional, and is not refused by Dash.

It is a common misunderstanding that you can use the Exec= line of a .desktop file as if it were a terminal window. That is not the case; expanding like ~/ or $HOME doesn't work for example. It is good (meaning: easy) practice to place more complicated commands in a separate script file, to be executed from the launcher file (your .desktop file)

Running complicated commands from a .desktop file

If you specifically want to keep your command inside your .desktop file, you should make it as follows:

Exec=sh -c "your_complicated_command_here && the_rest_of_it"
(command inside quotes)

Running a script from the .desktop file to do the job

Assuming that your command

cd /opt/sqldeveloper/sqldeveloper/bin && bash sqldeveloper $*

works from a terminal window, I would however simply create a small script:

#!/bin/bash
cd /opt/sqldeveloper/sqldeveloper/bin && bash sqldeveloper $*

Save it as scriptname.sh, and change the Exec= line of your .desktop file into:

Exec=sh /path/to/scriptname.sh

Then your .desktop file will show up in Dash

Note

That there are more issues with your .desktop file, as mentioned by @Braiam and @MrVaykadji. A few examples:

  • You should not use just use made up values in the Categories= line, as you can read here
  • The version field is not required, but if you use it, use 1.0

More can be found here. Good tools you can find here (also thanks to @Braiam and @MrVaykadji).

The critical one that makes your .desktop file not appear in Dash however is the Exec= line.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.