Ubuntu – How to get the shutdown & restart icon back in dash

12.04shutdownunityunity-dash

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?

Best Answer

  • 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