While shutting down (or other similar operations like restarting and logging-out) aren't difficult to launch in Ubuntu (you can find them in the Gear system menu on top-right corner of your desktop), some users - for whatever reason - may want to have a Unity Launcher icon for them.

In this tutorial, we will explain how you can quickly add a shutdown/restart/log-off icon to Unity launcher in Ubuntu. Please note that all the instructions mentioned here have been tested on Ubuntu 16.04LTS.

Add system shutdown icon in Unity launcher

For this, the first step is to create a file named shutdown.desktop in your Ubuntu system's ~/.local/share/applications directory. Once that is done, add following lines to the newly-created file:

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

Now, in your file browser, open the directory which contains the shutdown.desktop file. Here, right click on the file icon, then click Properties option, and then in the Permissions tab, enable the 'Allow executing file as program.'


After this, just drag and drop the file icon on to the launcher bar, and you'll see the icon gets placed there.


That's it. Now, whenever you'll click this icon, shutdown as well as related options will appear on your screen.



How to trigger system shutdown in Ubuntu from Unity launcher

One thought on “How to trigger system shutdown in Ubuntu from Unity launcher

Leave a Reply

Your email address will not be published. Required fields are marked *