2

I have this launcher I created with a quicklist full of options to execute different applications. One of the options is TeamViewer and this is the quicklist code for it:

[Desktop Action fav-teamviewer]
Name=TeamViewer
Exec=/opt/teamviewer9/tv_bin/script/teamviewer
OnlyShowIn=Unity

This works perfectly, but what if I wanted to execute the "teamviewer.desktop" file directly? Something like this...

[Desktop Action fav-teamviewer]
Name=TeamViewer
Exec=/usr/share/applications/teamviewer.desktop
OnlyShowIn=Unity

I've tried it, but it won't work. Why is it not working? Am I doing it wrongly or is it impossible to be done?

The reason I want to do it is that if I run TeamViewer normally, from the Dash, its icon on the Launcher is perfect (first image); but if I run it from that quicklist option, it loses its default icon and gets the generic Wine application icon (second image). Please, see screenshots for a better understanding.

If run from the Dash: If run from the QuickList:

I hope you can help me. Thanks for your attention.

10
  • That's because .desktop files aren't executables. Other apps (like Unity launcher) can read them and execute specifyed programms.
    – enedil
    Commented May 23, 2014 at 21:51
  • I see, enedil. So... is it impossible to do it? Isn't there a workaround or a legitimate way to do it, like using "xdg-open", "gnome-terminal -x" or whatever? I don't know. Thanks for your answer. :)
    – brunces
    Commented May 23, 2014 at 21:56
  • 1
    Use Exec=gtk-launch teamviewer.desktop /usr/share/applications Instead of Exec=/usr/share/applications/teamviewer.desktop To launch desktop file.
    – Pandya
    Commented May 24, 2014 at 4:32
  • I am pretty sure there is a solution, but I need to understand: do you run teamviewer under wine? there is a linux version, and the command seems no to call a wine application? Commented May 24, 2014 at 7:58
  • @JacobVlijm Linux version is Windows version with Wine included.
    – enedil
    Commented May 24, 2014 at 10:08

1 Answer 1

2

Desktop file can not be launched by directly from Exec. So, use gtk-launch as follows in your second file Exec option:

[Desktop Action fav-teamviewer]
Name=TeamViewer
Exec=gtk-launch teamviewer.desktop /usr/share/applications
OnlyShowIn=Unity

By this way you will be able to launch teamviewer.desktop by launching this file.


From man gtk-launch:

NAME
       gtk-launch - Launch an application

SYNOPSIS
       gtk-launch [APPLICATION] [URI...]

Reference of Use for desktop file:-

DESCRIPTION  
         gtk-launch takes at least one argument, the name of the application to launch.
The name should match application desktop file name, as residing in /usr/share/application, 
with or without the '.desktop' suffix.
2
  • @Glutanimate I added this answer.
    – Pandya
    Commented Aug 14, 2014 at 9:22
  • Ah, sorry. I didn't get a notification. +1 for the great answer! Commented Aug 22, 2014 at 17:57

You must log in to answer this question.

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