From what I can gather, .desktop files are shortcuts that allow application's settings to be customized. For instance, I have lots of them in my /usr/share/applications/ folder.
If I open that folder in nautilus, I can run these applications just by double clicking its associated file, e.g. double-clicking firefox.desktop runs Firefox. However, I can't find a way to do the same thing via terminal.
If I do
gnome-open foo.desktop it simply opens foo.desktop as a text file. If I make it exectuable and then run it in bash it simply fails (which is expected, it's clearly not bash script).
exec /fullpath/foo.desktop gives me a "Permission denied" message, even if I change ownership to myself. If I make executable and do the same command, the terminal tab I'm using simply closes (I'm guessing it crashes). Finally, if I do
sudo exec /fullpath/foo.desktop, I get an error reporting "sudo: exec: command not found".
That's my question, how can I run a foo.desktop file from the terminal?