Home > Technical > Add shutdown option to gnome 3 user menu & gdm / Disable Suspend in the status and gdm menu

Add shutdown option to gnome 3 user menu & gdm / Disable Suspend in the status and gdm menu

A quick way to do it system-wide for GNOME 3  is to change line of /usr/share/gnome-shell/js/ui/userMenu.js and line of /usr/share/gnome-shell/js/gdm/powerMenu.js.

(For GNOME versions prior to 3.2, look at line of /usr/share/gnome-shell/js/ui/statusMenu.js.)

Open the file in administrative mode or root privileges  using a text editor /usr/share/gnome-shell/js/ui/userMenu.js

// this._haveSuspend = this._upClient.get_can_suspend(); // Comment this line out.

this._haveSuspend = false;                                    // Use this line instead.

To accomplish this, paste the following command(s) in your terminal:

SCRIPTS=`grep -lr get_can_suspend $GNOME_SHELL/js`
for FILE in $SCRIPTS ; do
sed -r -i -e ‘s/[^= ]+.get_can_suspend\(\)/false/’ “$FILE”

This change takes effect the next time GNOME Shell is started.

The above change does not persist after a GNOME version update, however.

Alternatively you can install the GNOME shell extension “alternative status menu” .

  1. Robert Mayn
    October 26, 2012 at 12:31 AM

    If you’re afraid of editing files or of causing GNOME to break in mysterious ways upon updating, you can also hold down the ALT key and Suspend will change to Shutdown.

    • October 26, 2012 at 11:08 AM

      Now in gnome 3.6, shutdown is default menu option & if press alt, you will get suspend menu option.

      • October 29, 2012 at 11:53 PM

        Yeah, I remember reading that somewhere — that’s really how it should be (or a preference somewhere). I suspect after three years of Debian Wheezy (w/ 3.4) I will either use your method, change my behavior, add an extension or simply go nuts (always the easiest option). 🙂

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: