View Single Post
debernardis's Avatar
Posts: 2,142 | Thanked: 2,054 times | Joined on Dec 2006 @ Sicily
#8
If I were able, I'd modify the slidelock package (which I always use on my n810 - and also on my n800 after pushing the secret button which makes its secret sliding keyboard slide out) to set performance when the slide is open, and ondemand when it's closed. I'm going to ask Jgallen23 (the developer) to include this in his next version.

EDIT: I was able indeed. It's just a minor modification in /usr/lib/SlideLock/SlideLock.py. The modified version is as follows:

Code:
#!/usr/bin/env python
import dbus,gobject,time,os
from dbus.mainloop.glib import DBusGMainLoop


def main():
	slidestatus = '/sys/devices/platform/gpio-switch/slide/state'

	DBusGMainLoop(set_as_default=True)

	bus = dbus.SystemBus()

	tklock = bus.get_object('com.nokia.mce','/com/nokia/mce/request')

	def msg(id,obj):
		f = open(slidestatus,'r')
		status = f.read()
		f.close()
		if status == "closed\n":
			tklock.req_tklock_mode_change(dbus.String("locked"))
			os.system("echo ondemand >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor")

		if status == "open\n":
			os.system("echo performance >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor")

	bus.add_signal_receiver(msg,dbus_interface="org.freedesktop.Hal.Device",signal_name="PropertyModified",path='/org/freedesktop/Hal/devices/platform_slide')
	loop = gobject.MainLoop()
	loop.run()

if __name__ == "__main__":
	main()
Now let's see how many Coulombs does it burn
__________________
Ernesto de Bernardis


Last edited by debernardis; 2008-10-08 at 17:31.
 

The Following 2 Users Say Thank You to debernardis For This Useful Post: