2

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

Geek Guy
  • 121
  • @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? –  May 05 '17 at 23:28
  • 1
    @WillemK: I don't understand where you got the idea that linked question is about Xfce. – David Foerster May 07 '17 at 14:24
  • @davidbaumann: I don't think that's what OP is looking for. – David Foerster May 07 '17 at 14:25
  • @DavidFoerster: I didn't have an idea. I followed the link Davidbaumann offered and saw references to XFCE. –  May 07 '17 at 14:52
  • @WillemK: One of the answers assumes that the question is about Xfce (with no basis I might add) but it wasn't attracted little votes. – David Foerster May 07 '17 at 14:54
  • 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 07 '17 at 18:27
  • @GeekGuy Have you tried any of the solutions on the linked question? – Anwar May 09 '17 at 08:03

1 Answers1

1

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]
Categories=Application;System;
Comment=To shutdown the computer
Encoding=UTF-8
Exec=gnome-session-quit --power-off
Icon=system-shutdown
Name=Shutdown-Button
NoDisplay=false
StartupNotify=false
Terminal=false
Type=Application

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?

Takkat
  • 142,284