With one click, you can tell Ubuntu to shut down, reboot, hibernate, or sleep by creating shortcuts to terminal commands. You will be required to enter your root password to perform any of these actions, but these one-click solutions are faster than going into the menus.

To create these shortcuts, we will create a launcher on the top panel. To do this, right-click on any empty space on the top panel and select Add to Panel from the pop-up menu.

Selecting Add to Panel

On the Add to Panel dialog box, select the Custom Application Launcher option and click Add.

Selecting the Custom Application Launcher on the Add to Panel dialog box

On the Create Launcher dialog box enter a name for the launcher in the Name edit box. For this example, we are creating a launcher to shut the computer down, so we called it Shut Down.

In the Command edit box, enter one of the following four command, depending on which launcher you are currently creating.

  • gksu telinit 0 (shutdown)
  • gksu telinit 6 (reboot)
  • gksu /etc/acpi/hibernate.sh (hibernate)
  • gksu /etc/acpi/sleepbtn.sh (sleep)

To change the icon used for the launcher on the panel, click the icon button on the left side of the dialog box.

Changing the icon for the launcher

You can select an icon from the default collection that displays or you can search for a different icon. In our case, we wanted to find an icon that better represented the Shut Down action. To select an icon from a different collection, click the Browse button at the top of the dialog box.

Browse icons dialog box

In the /usr/share/icons/ directory, there are many collections of icons and pixmaps. We navigated to the /usr/share/icons/gnome/scalable/actions/ directory. You will not see any files listed. Click the Open button.

NOTE: You may have to click the Open button twice before you are returned to the Browse icons dialog box.

Browsing for a different icon

The images available in the selected directory are loaded into the Browse icons dialog box. We scrolled down and selected the system-shutdown.svg file. Click OK.

Browse icons dialog box with icon selected

You are returned to the Create Launcher dialog box and the newly selected icon is pictured on the left. Click OK.

Create Launcher dialog box with new icon selected

The launcher is added to the panel. To shut down the computer, just click the launcher button on the panel.

NOTE: You may not be asked for your password if you have recently used the gksu command. There is a short grace period in which the password is remembered.

Shut Down panel launcher

Aside from being asked to enter the root password, there is no confirmation of any of these actions. Before clicking any buttons that you create, be sure to save your work and also close open applications.

by Lori Kaufman