SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-12-04 04:21:42

stolid
#! CrunchBanger
Registered: 2012-09-06
Posts: 206

Hibernate instead of suspend?

I used to run Statler on my netbook, and it had Hibernate but not suspend (not a big deal, as I prefer hibernate). Now, I have the opposite since installing Waldorf. Why doesn't the exit/logout script have hibernate? It only shows suspend. I know I can install the hibernate package and just run its script, but what about the exit/logout menu script? Is it just not included or not showing for some reason?


Registered Linux User #555399
crunchbox:     Phenom II X6 1055T | 8GB RAM | OCZ Vertex 4 128GB | Radeon 7870XT | Win7 / #! 11 (i3 WM)
lambdacore:     4x Opteron 8431 | 16GB RAM | 2x1TB mirrored (ZFSoL) | Debian 7 (headless)
crunchtop:     Acer Aspire 1410 11.6" | 2GB RAM | Crucial M4 128GB | #! 11 (i3 WM)

Offline

Be excellent to each other!

#2 2012-12-04 16:53:23

thissideup
Member
Registered: 2010-12-24
Posts: 18

Re: Hibernate instead of suspend?

If you check menu.xml you find that "exit" calls the script cb-exit, which is located inside /usr/bin/. Opening it with your favorite editor let's you edit the python-file. When you look for suspend you will find the following:

	def suspend_action(self,btn):
		self.disable_buttons()
		self.status.set_label("Suspending, please standby...")
		os.system("cb-lock")
		os.system("dbus-send --system --print-reply --dest=\"org.freedesktop.UPower\" /org/freedesktop/UPower org.freedesktop.UPower.Suspend")
		gtk.main_quit()

and

		#Suspend button
		self.suspend = gtk.Button("_Suspend")
		self.suspend.set_border_width(4)
		self.suspend.connect("clicked", self.suspend_action)
		self.button_box.pack_start(self.suspend)
		self.suspend.show()

Now I haven't tried it myself, but in general, replacing every "suspend" with "hibernate" (in particular the long os.system call) should let you got ot hibernate through the exit-script.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo