Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

In Ubuntu 11.10 it was possible to type restart or shutdown in dash, so you could drag that icon in the left panel. Now in the new 12.04 this option has been deleted/removed. Is there another way to get those icons back?

share|improve this question
    
I find this: iloveubuntu.net/… –  Arpad Horvath Aug 5 '12 at 13:27

5 Answers 5

One solution is to create two .desktop files in your home folder ~/.local/share/applications with the 11.10 restart and shutdown equivalent files.

Create a text file named as below in the folder. Repeat this for the second desktop file.

Dash will automatically display restart and shutdown when you type these into dash.

step by step

Open a terminal and copy and paste the following one line at a time

mkdir -p ~/.local/share/applications
gedit ~/.local/share/applications/indicator-session-restart.desktop

Copy and paste the text below for indicator-session-restart.desktop starting from [Desktop Entry] and ending X-Ubuntu-Gettext-Domain=indicator-session

Save and close.

gedit ~/.local/share/applications/indicator-session-shutdown.desktop

Copy and paste the text below for indicator-session-shutdown.desktop starting from [Desktop Entry] and ending X-Ubuntu-Gettext-Domain=indicator-session

Save and close.

indicator-session-restart.desktop

[Desktop Entry]
Name=Restart
TryExec=/usr/lib/indicator-session/gtk-logout-helper
Exec=/usr/lib/indicator-session/gtk-logout-helper --restart
Icon=system-restart
Terminal=false
Type=Application
OnlyShowIn=Unity;
Categories=System;
Version=1.0
X-Ubuntu-Gettext-Domain=indicator-session

indicator-session-shutdown.desktop

[Desktop Entry]
Name=Shut Down
TryExec=/usr/lib/indicator-session/gtk-logout-helper
Exec=/usr/lib/indicator-session/gtk-logout-helper --shutdown
Icon=system-shutdown
Terminal=false
Type=Application
OnlyShowIn=Unity;
Categories=System;
Version=1.0
X-Ubuntu-Gettext-Domain=indicator-session
share|improve this answer
    
thanx for the reply, tried this, but cannot get it working... I probably do something wrong. I'm not an Ubuntu expert, just trying to help somebody with this issue... –  user57692 Apr 28 '12 at 12:42
    
ok - I've added some step-by-step instructions. –  fossfreedom Apr 28 '12 at 14:08

Press Alt don't hold it, this brings up HUD type Shut Down press Enter you may find restart on that . That is the easy solution :)

enter image description here

share|improve this answer
    
I tried it, but i cannot drag the icon back in to the left panel... –  user57692 Apr 28 '12 at 11:43
    
i read about those icons are desktop-files that have been removed in the new ubuntu... If they were there in the 11.10 version, i wonder if i cannot make those files myself? –  user57692 Apr 28 '12 at 12:22

To save space I combined all three actions into one launcher:

[Desktop Entry]
Name=Log Out
TryExec=/usr/lib/indicator-session/gtk-logout-helper
Exec=/usr/lib/indicator-session/gtk-logout-helper --logout
Icon=system-shutdown
Terminal=false
Type=Application
OnlyShowIn=Unity;
Categories=System;
Version=1.0
X-Ubuntu-Gettext-Domain=indicator-session

Actions=Restart;ShutDown;

Name[en_US]=Log Out

[Desktop Action ShutDown]
Name=Shut Down
Exec=/usr/lib/indicator-session/gtk-logout-helper --shutdown
OnlyShowIn=Unity;

[Desktop Action Restart]
Name=Restart
Exec=/usr/lib/indicator-session/gtk-logout-helper --restart
OnlyShowIn=Unity;
share|improve this answer

Here's the update file for "Trusty Tahr"

[Desktop Entry]
Name=Log Out
Exec=dbus-send --session --type=method_call --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager "org.gnome.SessionManager.Logout" uint32:1
Icon=system-shutdown
Terminal=false
Type=Application
OnlyShowIn=Unity;
Categories=System;
Version=2.0
X-Ubuntu-Gettext-Domain=gdm

Actions=Restart;Suspend;ShutDown;

Name[en_US]=Log Out

[Desktop Action Restart]
Name=Restart
Exec=dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:true
OnlyShowIn=Unity;

[Desktop Action Suspend]
Name=Suspend
Exec=dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Suspend" boolean:true
OnlyShowIn=Unity;

[Desktop Action ShutDown]
Name=Shut Down
Exec=dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.PowerOff" boolean:true
OnlyShowIn=Unity;

Source: forum.ubuntu-fr.org

share|improve this answer

On Ubuntu 14.04 I had to change the Exec= line for shut down to

    Exec=dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.PowerOff" boolean:true

as in askubuntu.com-What command is executed when shutdown from the graphical menu in 14.04?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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