I'm making a custom launcher/desktop file to place in the Unity Launcher Bar. However, when I drag the launcher icon from ~/.local/share/applications
, it disappears immediately. This is probably caused by a syntax error in my .desktop
file. Is there a unity log file I can look at to find what the problem is?
-
1Many people have recommended the Create Launcher app from Marian Lux, which is available at the Ubuntu Software Center.– dhulihanAug 13, 2012 at 19:15
2 Answers
I had the same kind of problems. I can give you 2 directions:
- Use an application like 'Create Launcher' from mlux.at to create the launcher.
- If it is a shell script and you cannot launch it, then do an echo of the command that is executed and put this command into a script of your choice and use this one into the launcher.
Ex:
echo $_JAVA_EXEC $_VM_PROPERTIES -Xmx${MAXIMUM_HEAP_SIZE} -Dsmartsvn.vm-xmx=${MAXIMUM_HEAP_SIZE} -jar "$SMARTSVN_HOME/lib/smartsvn.jar" "$@"
was in smartsvn.sh
I created a file smart.sh and put inside
/home/rudy/opt/jdk1.6.0_33/bin/java -XX:-UseSSE42Intrinsics -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -Xmx256m -Dsmartsvn.vm-xmx=256m -jar /home/rudy/opt/smartsvn-7_0_4/lib/smartsvn.jar
This time it was successful.
Hope it helps.
A way to go :
1) use create launcher. The files are located into ~/.local/share/applications.
example 1 :
[Desktop Entry]
Version=1.0
Type=Application
Name=IntelliJ IDEA
Exec="/home/rudy/opt/idea-IU-117.105/bin/idea.sh" %f
Icon=/home/rudy/opt/idea-IU-117.105/bin/idea.png
Comment=Develop with pleasure!
Categories=Development;IDE;
Terminal=false
StartupNotify=true
StartupWMClass=jetbrains-idea
example 2 :
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Name=Squirrel
Comment=squirrel sql database
Exec="/home/rudy/opt/squirrel-sql-3.3.0/squirrel-sql.sh"
Path=/home/rudy/opt/squirrel-sql-3.3.0/
Icon=/home/rudy/opt/squirrel-sql-3.3.0/icons/acorn.png
Categories=Development;
StartupNotify=true
StartupWMClass=net-sourceforge-squirrel_sql-client-Main
example 3 :
#!/usr/bin/env xdg-open
#ManageLauncher_Version=1.0
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Name=Idle
Comment=python
Exec="idle"
Icon=/home/rudy/resources/icons/python_icon.gif
Categories=Accessibility;
StartupNotify=true
StartupWMClass=Toplevel
Name[en_US]=Idle
In these example, there are 2 kind of launchers. Launchers of java applications and launchers of non java applications.
Do an echo of the sh that is called and put this command in a script and use it... (if it doesn't work the normal way of course)
2) Add StartupNotify and StartupWMClass if necessary
I have to reference the resource name and it is difficult to find. Use xprop WM_CLASS to discover the resource name. If it is java, it is the main class where the dots were replace by underscores. Start xprop, then click on the application.
3) Drop the file into the launcher bar.
The StartupNotify/StartupWMClass, a way to avoid to start several times the same applications if you click again on the icon...