How can I add a shutdown button to this menu?

In mine it is missing and I am only able to shut down through terminal. My menu only has lock and logout options, and even the logout option doesn't respond when I click it. I want it to appear like this:

shutdown icon in menu

  • @davidbaumann: I don't want to question your experience answering questions, but what made you think Geek Guy is using XFCE/Xubuntu ? From the link I get the impression he has Unity? – user680858 May 5 '17 at 23:28
  • 1
    @WillemK: I don't understand where you got the idea that linked question is about Xfce. – David Foerster May 7 '17 at 14:24
  • @davidbaumann: I don't think that's what OP is looking for. – David Foerster May 7 '17 at 14:25
  • @DavidFoerster: I didn't have an idea. I followed the link Davidbaumann offered and saw references to XFCE. – user680858 May 7 '17 at 14:52
  • 1
    Am using the latest ubuntu 17.04 as indicated in the title of the edited question, I would be glad to get an answer please. – Geek Guy May 7 '17 at 18:27

What I had added to all my launchers is a shutdown icon:

enter image description here

When clicked it will call the following dialog:

enter image description here

Save a file named shutdown.desktop in ~/.local/share/applicatons with this content

[Desktop Entry]
Comment=To shutdown the computer
Exec=gnome-session-quit --power-off

To do this, copy all the lines above, open the "Text Editor" (search in Dash) Gedit to paste the text in the still empty page. Then choose File > Save, press CtrlH to show hidden files, browse to .local/share/applications and save as shutdown.desktop:

enter image description here

Then open the file browser Nautilus to again browse to ~/.local/share/applications/ to then right click on the shutdown.desktop file you had just created there.

Click on it with the right mouse button to open the context dropdown menu. Select the last entry Properties. In the following dialog open the Permissions tab to tick on Allow executing file as program:

enter image description here

Watch the icon change to the red shutdown icon. You can then drag this icon to the launcher:

enter image description here

On clicking on this new entry the following shutdown dialog will appear:

enter image description here

To have it turn off after a countdown see the following question: How do I call gnome-session-quit with countdown from Unity?

  • Thank you @Takkat, I am new to ubuntu and would wish to get commands of creating this file and providing the permissions. Please show. – Geek Guy May 7 '17 at 18:24
  • Hi @Takkat I have done but it is not working even if I click it from the launcher. – Geek Guy May 7 '17 at 19:22
  • @GeekGuy: see edit... hope it's clearer now. – Takkat May 7 '17 at 19:32

Not the answer you're looking for? Browse other questions tagged or ask your own question.