5

I have some problem with my Nvidia Graphics and suspending (I can't resume from suspend). So I usually avoid suspending my computer.

But sometimes I accidentally click on Suspend when trying to Shutdown. Which suddenly suspends my computer without giving any warning!. I will have to boot it again (where I get stuck on a blank screen) and long press my power-button and restart my computer.

enter image description here

I get a warning like this before shutting down.

enter image description here

I would like to get a similar warning when I accidentally click on Suspend too.

Zanna
  • 72,312
Severus Tux
  • 10,126

1 Answers1

5

While modifying the source of the indicator itself ( in my humble opinion ) is the best approach ( and probably the feature request for that is even better approach ) ,one can create custom session control to be placed onto the launcher , which is fairly easy to achieve. That way, we can have suspend options which does ask for user confirmation.

The .desktop file bellow allows mimicking the 3 options from the session indicator in the top panel: Shutdown , Suspend , and Logout. Double clicking on the icon by default will bring up confirmation for shutdown. Right clicking on the entry will bring up the list of other options.

Preferably , you'd want it to be stored in ~/local/share/applications folder and have executable permissions. Naming doesn't matter, personally I named it session-control.desktop

File contents

[Desktop Entry]
Name=Shutdown the System
Comment=Alternative session control , main entry will bring up shutdown or reboot dialog but Suspend and Logout will bring up confirmation dialog.
Terminal=false
Actions=Suspend;Logout
Type=Application
Exec=qdbus com.canonical.Unity /com/canonical/Unity/Session com.canonical.Unity.Session.RequestReboot
Icon=/usr/share/unity-greeter/cof.png

[Desktop Action Suspend]
Name=Suspend the System
Exec=qdbus com.canonical.Unity /com/canonical/Unity/Session com.canonical.Unity.Session.RequestShutdown
Terminal=false

[Desktop Action Logout]
Name=Logout the User
Exec=qdbus com.canonical.Unity /com/canonical/Unity/Session com.canonical.Unity.Session.RequestLogout
Terminal=false

How it looks

Launcher entry

Launcher entry with all options visible

The dialog that comes up if you click on Suspend

Unity's shutdown dialog that comes up when you click on Suspend option, among others Suspend is there on the dialog as well