Desktop launcher app, raspbian, Python

Discussion in 'Programmer's Corner' started by Vindhyachal Takniki, Jul 21, 2015.

  1. Vindhyachal Takniki

    Thread Starter Member

    Nov 3, 2014
    1. I am using raspberry pi 2 board with raspbian loaded.
    2. I have made python program which have multiple files.
    Like I have which calls spi library for RPi.
    3. Then time library is used to call functions like time.sleep() & Some of my own files.
    4. Now I want to create a desktop laucnher for that app. So that it appear on desktop & on double click it runs.
    5. I have made below code by commandline but it don't work. How to do this.
    6. I think problem is I have written only in below code, but in actual code I have 8 .py files.

    Code (Text):
    2. [Desktop Entry]
    3. Encoding=UTF-8
    4. Version=1.0                                     # version of an app.
    5. Name[en_US]=yEd                                 # name of an app.
    6. GenericName=GUI Port Scanner                    # longer name of an app.
    7. Exec=python  /home/                      # command used to launch an app.
    8. Terminal=false                                  # whether an app requires to be run in a terminal.
    9. Icon[en_US]=/home/yicon32.png                   # location of icon file.
    10. Type=Application                                # type.
    11. Categories=Application;Network;Security;        # categories in which this app should be listed.
    12. Comment[en_US]=yEd Graph Editor                 # comment which appears as a tooltip.
  2. nerdegutta


    Dec 15, 2009
    Do you have to make the *.py file executable? chmod +x?
  3. Vindhyachal Takniki

    Thread Starter Member

    Nov 3, 2014
    yes I had made that.
    I had solved the problem by first creating bash file & then same process followed. It worked
  4. strantor

    AAC Fanatic!

    Oct 3, 2010
    I don't know what I'm talking about because I've never used RPI (though I have one, and want to) or Linux (though I want to), but maybe I can still be of help.
    Have a look at this. Specifically, this:
  5. tjohnson

    Active Member

    Dec 23, 2014
    I also learned that in order for a Python script to be executable in Linux, it must have Unix line endings. (See my thread on the Fedora forum.)

    @strantor: What a pity that you have an RPi but don't use it!:rolleyes:
  6. nerdegutta


    Dec 15, 2009
    I also have an RPI I do not use, but then again, I have three that I use. :D:cool: