In a .desktop file you can specify the
Path key in a [Desktop Entry] so that the working directory will be that path when the
Exec is launched. However, this key does not seem to work when launching items from Quicklist even though the
Path key is set in the [Desktop Action] group. Am I doing something wrong or does Unity not support this yet?
If there's no way to do this, can I change the Exec key in some way to get the same effect?
EDIT: For testing purposes, here's an example little script (displaycwd.py) that when run displays the current working path in a Gtk window. There's an example .desktop file that follows showing that when run normally through the Launcher it opens with the right path (/home/ian/Documents in my case). However, activating it through a quicklist, displays the user directory (/home/ian in my case) instead. Just make sure to put the script somewhere in your $PATH.
#!/usr/bin/python from gi.repository import Gtk import os pwd=os.path.realpath(os.curdir) win=Gtk.Window() label=Gtk.Label(pwd) win.add(label) win.show_all() win.connect('destroy', Gtk.main_quit) Gtk.main()
And the .desktop file:
[Desktop Entry] Name=Display Working Directory Exec=displaycwd.py Type=Application Actions=quicklist Path=/home/ian/Documents Icon=folder [Desktop Action quicklist] Name=QL Display WD Exec=displaycwd.py Path=/home/ian/Documents