Here we will make two .desktop files that will launch Pupil Capture and Pupil Player.
- Right click on your desktop and create a new empty document.
- Set the document file type by Renaming the document that ends with
.desktop - Drag the document into a text editor and edit the document with the example code below
Note: Change the X-Icon-Path to the icon you want to use and Execpath to where Pupil Capturemain.py` is located on your machine (see example pupil.desktop for reference)
[Desktop Entry]
Name=Pupil Capture
Version=v0.8.5
Icon=pupil-capture
X-Icon-Path=/path/to/icon/file/
Exec=python /path/to/py/file/main.py
Terminal=false
Type=Application
Option - you can use Terminal=true to launch the terminal if desired.
In the terminal set the permissions of the desktop file to be executable by typing this:
chmod u+x path/to/py/file/main.py
Right click on the new empty document and in the Permissions tab, set the execute to allow executing file as program.
Nice! Thanks! Sooo.... what if I have a python script that needs parameters when executed? Is it possible to click an icon on the desktop, have it ask for the desired parameter and then execute the full command in a terminal window?