I have an icon for gedit in my launcher in Ubuntu 16.04. I had a problem with multiple icons in the launcher (see, e.g., Why are there two icons in the Unity launcher for Nautilus?), which I solved by some random unlock from launcher-lock to launcher actions. Now I have a single icon that starts gedit.
However, when I click on this icon, gedit is started in
/. This is visible in the embedded terminal and in the save location for new documents (as well as the location for 'open other documents' when a new document is in focus).
How can I change this location? I tried to edit
/usr/share/applications/org.gnome.gedit.desktop to read
Exec=cd ~;gedit %U but that resulted in
compiz being active for 10sec at 15% cpu and then terminating without starting gedit.
When I start gedit from the terminal in any directory the location is set to this directory.
I also have a
/usr/share/applications/gedit.desktop file but it is not used.
dconf-editor shows that the
org.gnome file is used, and indeed making changes to this file (e.g., changing captions) is reflected in the launcher.