9

everyone. I use zotero for my studies and downloaded a tar.gz-file from their website. When I extract it, it has an executable shell script that launches the programme. I wanted to be able to start Zotero from slingshot instead of having to browse to the folder every time I want to open it. So I created my own .desktop file which is called zotero.desktop and I created it while running scratch as root and placed it in /usr/share/applications/ This is the file:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Zotero
Comment=Bibliografisch programma
Exec=/home/lieven/ICT/Configuratie en Setup/Zotero_linux-x86_64/zotero
Icon=/home/lieven/ICT/Configuratie en Setup/Zotero_linux-x86_64/chrome/icons/default/default48.png
Categories=Utility
Terminal=false

But when I open slingshot and type in Zotero, it isn't listed as an entry. This is also the case after logging out and restarting the computer. What can I do to be able to open Zotero from within slingshot?

2

3 Answers 3

7

Correct content of zotero.desktop as follows:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Zotero
Comment=Bibliografisch programma
Exec=/home/lieven/ICT/Configuratie\ en\ Setup/Zotero_linux-x86_64/zotero
Icon=/home/lieven/ICT/Configuratie\ en\ Setup/Zotero_linux-x86_64/chrome/icons/default/default48.png
Categories=Utility
Terminal=false

Path with space should contain a backslash.

Also make zotero.desktop executable through Terminal:

sudo chmod +x /usr/share/applications/zotero.desktop

PS: No need to get into system files, *.desktop with same success can be placed in ~/.local/share/applications. In this case, command to change permissions of an executable file will look like this:

chmod +x ~/.local/share/applications/zotero.desktop
5
  • 1
    Thanks a lot, this worked flawlessly. Thanks for the tip to put it in the user's configuration folder, but there are other users on the machine that use the programme, that's why I put it in /usr/share/applications/.
    – user72805
    Commented Oct 15, 2015 at 18:10
  • @user72805, I'm glad that my answer helped you. Offtop: my English is very bad?
    – png2378
    Commented Oct 15, 2015 at 18:36
  • 1
    You can see that you're not a native speaker, but it's good enough for getting the message across. It's fine, but I'm not a native speaker either :-).
    – user72805
    Commented Oct 16, 2015 at 10:42
  • I'm trying to setup my desktop file but for some reason it doesn't work. My exec is Exec=/home/jena/miniconda3/bin/jupyter-qtconsole --kernel=ir (note the space before the parameter). Clicking the icon in launcher will show icon on the dock for a moment, but then it disappears. If I put backslash there (i.e. jupyter-qtconsole\ --kernel=ir) then it disappears from the launcher. Same if I put it in either single- or double-quotes. If I remove the parameter, it launches fine, but with default python kernel, while I need R kernel. So clearly the space before parameter is the problem. Any idea?
    – jena
    Commented Dec 16, 2020 at 9:01
  • aha so apparently the = is the problem - does anybody know how to resolve it?
    – jena
    Commented Jan 6, 2021 at 15:28
0

this is for raspberry pi where you run your program in a terminal

create a desktop file (runthis.desktop) in /home/pi/.config/autostart

copy these lines to the file (runthis.desktop)

[Desktop Entry] 

Encoding=UTF-8

Type=Application

Name=RootCam

Comment=

Exec=x-terminal-emulator --working-directory=/home/pi/projects/RootCam/main -e /home/pi/projects/RootCam/main &

StartupNotify=true

Terminal=true
Hidden=false

change working directory and executed program to your desire

reboot pi

tell your parents you love them

0

There is a convenient way of managing .desktop files via GUI interface too: AppEditor

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.