I came across this command using gsettings to add a .desktop file to the launcher you may be able to use.
Code:
gsettings set com.canonical.Unity.Launcher favorites "$(gsettings get com.canonical.Unity.Launcher favorites | sed "s/, *'yourapp.desktop' *//g" | sed "s/'yourapp.desktop' *, *//g" | sed -e "s/]$/, 'yourapp.desktop']/")"
I can add a .desktop file from ~/.local/share/applications to the launcher,
even when the .desktop file does not show with a dash search.
eg I created a new user account and created the directory ~/.local/share/applications and placed
the mytest.desktop file in it.
Searched the dash. No results.
Ran the command...
Code:
gsettings set com.canonical.Unity.Launcher favorites "$(gsettings get com.canonical.Unity.Launcher favorites | sed "s/, *'mytest.desktop' *//g" | sed "s/'mytest.desktop' *, *//g" | sed -e "s/]$/, 'mytest.desktop']/")"
...and it shows up immediately in the launcher.
Bookmarks