Recently I wanted to add an icon to a panel in Gnome to suspend my laptop (to RAM.) Some googling didn’t immediately find a way to do this. Gnome includes a “Shutdown” applet but it brings up the shutdown dialog which I want to skip. There were also some mentions of running pm-suspend but if you do that it will suspend without Gnome knowing about it–with the side effect of no login prompt on being awakened.
So, here is how I did it. Note that these instructions were done on Fedora 9 although it shouldn’t matter except maybe for choosing the icon.
First, right click a panel where you want the icon and choose “Add to Panel”.
Now choose “Custom Application Launcher”.
Now you need to fill in the fields as shown, the “/usr/bin/gnome-power-cmd.sh suspend” is the magic that keeps Gnome happy.
You can click on the icon box and choose anything you like. The one I used is located at “/usr/share/icons/hicolor/48×48/apps/gnome-inhibit-applet.png” which is for an unrelated applet but I liked it.
So there you have it. An icon that goes straight to suspend without the shutdown dialog.



E-mail Me


0 Responses to “Add suspend icon to Gnome panel”
Leave a Reply