3

I have sccceded in making launchers with python scripts,php scripts,etc as launchers.

Now I want to make a binary file as a launcher. It is not an installable binary file. It is actually the binary file for WorldOfGoo. The filename is WorldOfGoo.bin32. On runing this file from terminal by the command ./WorldOfGoo.bin32 the game starts.

when i added the path to this file in the Exec field in the [Desktop Entry], like this

/path/to/folder/and/then/WorldOfGoo.bin32 *

and when I clicked on the desktop file,it says "Permission Denied"

How do i get a binary file to work in a .desktop file?

3
  • 1
    Permission Denied would normally say that you should chmod +x WorldOfGoo.bin32. Is it a typo or are you using "./path/to/folder/and/then/WorldOfGoo.bin32" (with the leading dot) in the Exec field?
    – onse
    Jun 21, 2012 at 10:27
  • you have to make sure that the binary file as well as the .desktop file have executable permissions
    – Daniel W.
    Jun 21, 2012 at 10:39
  • Why should .desktop file have executable permissions? isnt it just a plain text file?
    – balki
    Jun 28, 2012 at 8:12

3 Answers 3

4

Here's an example - it starts xnview.sh:

[Desktop Entry]
Encoding=UTF-8
Terminal=0
Exec=/home/pierre/Desktop/XnViewMP/xnview.sh
Icon=/home/pierre/Desktop/XnViewMP/xnview.png
Type=Application
Categories=Graphics;
StartupNotify=true
Name=XnView Multi Platform
GenericName=XnViewMP

Edit:

If You have a nasty complex command to be run - put it all in script and run the script. For example if You have to cd there first, and run the script from there make a script:

#!/bin/bash

cd /to/YourDir
./YourBinaryFile
9
  • its not workin...i mean the game starts but just exits within a second..!!
    – Nirmik
    Jun 21, 2012 at 19:00
  • Try to add ampersand after the shell command. How does it work - if You'll just run the binary from the shell?
    – Adobe
    Jun 22, 2012 at 18:05
  • Oh I see it in Your question - You can start the thing from terminal. You can then put Exec=gnome-terminal -e '/path/to...' or Exec=konsole -e '/path/to...' if You are using KDE.
    – Adobe
    Jun 22, 2012 at 20:13
  • nope...it still exits..this happens even for a simple softlink of that file you know...even that does not work...its like u have to go to the particular folder and then only ude it!
    – Nirmik
    Jun 22, 2012 at 22:21
  • If You have to go there - it's not a problem: Exec=cd /to/Your/Folder; ./YourBinary
    – Adobe
    Jun 23, 2012 at 16:30
1

Sample:

  1. Make *.sh file home folder.
    Make it executable.
    Change your user name to your own (.sh and .desktop file):

    nano qtwaifu2x.sh

     #!/bin/bash
     cd /home/user/git/build-qtwaifu2x-Desktop-Debug
     ./qtwaifu2x
    
  2. Make desktop files (qtwaifu2x.desktop)

    nano qtwaifu2x.desktop

     [Desktop Entry]
     Version=1.1
     Name=Qtwaifu2x
     Comment=Image Super-Resolution for Anime-Style Art
     Exec=/home/user/qtwaifu2x.sh
     Icon=qtwaifu2x
     Terminal=false
     Type=Application
     Categories=Graphics;ImageProcessing;
    
  3. Copy qtwaifu2x.desktop to /usr/share/applications

  4. Copy qtwaifu2x.png + svg to /usr/share/icons

  5. Use slink /usr/share/applications/qtwaifu2x.desktop to my desktop.

  6. Desktop icon -> right click menu -> enable startup

...and done.

0

There is a tool called alacarte, it is a user-friendly tool to create .desktop files. You can install it: sudo apt install alacarte.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .