Adsense

  • Latest News

    Monday, 27 June 2016

    How to create desktop shortcut for python scripts in Raspberry Pi


    If you are unable to create new .desktop file in raspberry pi desktop or /usr/share/applications directory then here is easy trick to create shortcuts of your python codes or scripts.
    This works for all GUI packages(pyqt4, tkinter etc) & GPIO libraries.

    1. Move to desktop or this directory /usr/share/applications
    2. Copy any .desktop file: sudo cp python2.7.desktop myapp.desktop
    3. Edit myapp.desktop file: sudo nano myapp.desktop
    4. [Desktop Entry]
      Encoding=UTF-8
      Type=Application
      Name=MyApp
      Icon=/home/pi/myapp.xpm
      Exec=/usr/bin/python /home/pi/myapp.py
      Comment[en_US]=Hardware info
      StartupNotify=true
      Categories=Utility
      Replace myapp.pymyapp.xpm with your file. Convert .png icon to .xpm & size<= 32x32.

    5. Press Ctrl+X & Y to save the changes. Shortcut created for your python applications & now just double click to open.

    For any other clarifications comment



    • Blogger Comments
    • Facebook Comments

    0 comments:

    Post a Comment

    Item Reviewed: How to create desktop shortcut for python scripts in Raspberry Pi Rating: 5 Reviewed By: Vishal Aditya
    Scroll to Top