How can I add my username to the top panel in Xenial Xerus?

The standard (and easiest) way to display your user name in the Unity panel is to launch System Settings and go to User Accounts.

You can see a checkbox at the bottom of the window that says

Show my login name in the menu bar

Simply enable that checkbox and your display name appears in the top right corner of your screen.

enter image description here


The username of the currently logged in user can easily be placed in the top panel by using either:

  1. A purely command line method
  2. A gui method

1. Command line method:

Open a Terminal window with the key combination Ctrl+Alt+T and run the following command:

gsettings set com.canonical.indicator.session show-real-name-on-panel true

Below is a screenshot to demonstrate the successful result:

enter image description here

And this can be easily be subsequently reversed by running the following command in a Terminal window:

gsettings set com.canonical.indicator.session show-real-name-on-panel false

Easy enough to do but some will always prefer a gui solution:

2. Gui method:

If you prefer to accomplish this from a gui install the unity-tweak-tool as follows:

sudo apt-get install unity-tweak-tool

The required setting can be found by opening the Tweak Tool and then following this path:

Unity >> Panel >> Indicators

The exact setting is illustrated in the screenshot below:

enter image description here

And of course the Unity Tweak Tool will allow many,many other small refinements...