Gtk-launch is used as follows: gtk-launch APPLICATION It is usually part of the package libgtk-3-bin (this may vary by distro). You should really be using gtk-launch if it is available. It will be useless work when gvfs-open will solve the bug, but in the meantime. Hashbang on top of an executable desktop entry works too desktop entry on ~/.local/share/applications/sktop: įinally, I associated the entry as the default handler in ~/.local/share/applications/mimeapps.list under the section as : Īpplication/x-desktop=sktop The script needs to have the executable permission, so I ran this in a terminal: chmod +x ~/bin/run-desktop It is a bit convoluted, but works flawlessly on Ubuntu 12.10, adding a meaningful icon (no more ?) on the Unity launcher.įirst, I wrote a python script using Gio and placed saved it as ~/bin/run-desktop : #!/usr/bin/python Still, I managed a quick workaround (stealing inspiration from the nautilus source code). It is in fact depending on how gvfs-open (called by xdg-open) works. None of them are relevant for launching at the command line. The arguments ( %u, %F etc) are detailed here. Then make it executable chmod +x ~/bin/deskopenĪnd then you could do, e.g. You could put this in a file, say ~/bin/deskopen with the contents #!/bin/sh & # - at the end means run it in the background $(.) # - means run the result of the command run | sed 's/^"//g' | sed 's/" *$//g' # - removes " around command (if present) | sed 's/%.//' # - removes any arguments - %u, %f etc | sed 's/^Exec=//' # - removes the Exec from the start of the line | tail -1 # - only use the last line, in case there are To break that down grep '^Exec' sktop # - finds the line which starts with Exec
![kill macupdate desktop from terminal kill macupdate desktop from terminal](https://miro.medium.com/max/1200/1*UdT9kfCeddr353kQDqB7_A.jpeg)
![kill macupdate desktop from terminal kill macupdate desktop from terminal](https://i.ytimg.com/vi/9_cRKlhO7Sw/maxresdefault.jpg)
The command that is run is contained inside the desktop file, preceded by Exec= so you could extract and run that by: $(grep '^Exec' sktop | tail -1 | sed 's/^Exec=//' | sed 's/%.//' \ Written a long time ago - see the comments below this answer as to why this approach won't work for many desktop files. See another answer on this thread for more details.
![kill macupdate desktop from terminal kill macupdate desktop from terminal](https://i.ytimg.com/vi/1iM12XyQPJE/maxresdefault.jpg)
Gtk-launch - where is the file name of the.