How do I change the desktop name on the Unity panel?

There's a much quicker way than doug's method, by abusing the gettext translation system. Assuming you are using an English locale:

#Make a temporary text file using vim/gedit/cat/whatever
cat > /tmp/foo.po
msgid "Ubuntu Desktop"
msgstr "A Badger With A Gun"
^D

cd /usr/share/locale/en/LC_MESSAGES
sudo msgfmt -o unity.mo /tmp/foo.po

Then, either log out and back in, or just execute:

unity --replace

You would likely need to build the unity or unity-2d source. Currently, in unity-5.12, it would be found in /plugins/unityshell/src/PanelMenuView.cpp, line 78:

 _desktop_name(_("Ubuntu Desktop"))

In unity-2d, unity-2d 5.12: /panel/applets/appname/appnameapplet.cpp, line 369:

d->m_label->setText(u2dTr("Ubuntu Desktop"));

It appeared that, The Text on top-left corner uses the value from the file /usr/lib/os-release file. So, We need to edit the value for NAME key on that file only.

  1. Open with nano

    sudo nano /usr/lib/os-release
    
  2. Change the value of NAME from the first line. I changed it to L Buntu just for testing. The file's content after change

    NAME="L Buntu"
    VERSION="16.04.1 LTS (Xenial Xerus)"
    ID=ubuntu
    ID_LIKE=debian
    PRETTY_NAME="Ubuntu 16.04.1 LTS"
    VERSION_ID="16.04"
    HOME_URL="http://www.ubuntu.com/"
    SUPPORT_URL="http://help.ubuntu.com/"
    BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
    UBUNTU_CODENAME=xenial
    
  3. Logout and Login again to see the change.

    Here is a tiny screenshot after change.

    screenshot after change

Tested on 16.04.