| The Following 7 Users Say Thank You to m2cm2c For This Useful Post: | ||
|
|
2010-03-11
, 15:51
|
|
Posts: 755 |
Thanked: 406 times |
Joined on Feb 2008
@ UK
|
#2
|
|
|
2010-03-11
, 15:58
|
|
|
Posts: 100 |
Thanked: 240 times |
Joined on Feb 2010
@ The South Pole O.o
|
#3
|
Haven't tried this (or the other), but check out shake2control.

| The Following User Says Thank You to m2cm2c For This Useful Post: | ||
|
|
2010-03-11
, 16:16
|
|
Posts: 2,014 |
Thanked: 1,581 times |
Joined on Sep 2009
|
#4
|
|
|
2010-03-11
, 16:33
|
|
|
Posts: 100 |
Thanked: 240 times |
Joined on Feb 2010
@ The South Pole O.o
|
#5
|
Does this check the prox sensor for being covered before skipping the track (I am no expert in python but didnt see anything suggesting it did). I prefer if it doesnt since I keep my n900 in its case most times.

|
|
2010-03-11
, 16:42
|
|
Posts: 2,014 |
Thanked: 1,581 times |
Joined on Sep 2009
|
#6
|
well I made this script so I can change the track even if it is inside the n900 cover, say I'm transmitting a FM station to my car, I don't want to take it outside the cover to get it working,
also this script is pretty smart when it gets to shaking the phone, I didn't encounter any random track changes yet
try it out and tell me what you think.
Will check the script and let you know.
|
|
2010-03-11
, 17:43
|
|
Posts: 4,556 |
Thanked: 1,624 times |
Joined on Dec 2007
|
#7
|
|
|
2010-03-11
, 18:33
|
|
Posts: 88 |
Thanked: 28 times |
Joined on Feb 2010
@ Hyderabad, India
|
#8
|
|
|
2010-03-11
, 22:20
|
|
|
Posts: 100 |
Thanked: 240 times |
Joined on Feb 2010
@ The South Pole O.o
|
#9
|
hmm doesn't seem to work for me. it just displays changes in slope level when i move and shake the N900.
| The Following User Says Thank You to m2cm2c For This Useful Post: | ||
|
|
2010-03-12
, 00:17
|
|
|
Posts: 100 |
Thanked: 240 times |
Joined on Feb 2010
@ The South Pole O.o
|
#10
|
| The Following 2 Users Say Thank You to m2cm2c For This Useful Post: | ||
I've made a simple python script to skip to the next track when you shake the phone
heres what you have to do:
extract the script to your phone
open the media player and start playing music
open the terminal and:
cd to the directory of the script
type in:
python skipshake.py
shake the phone and see the results
when you're done with the script close the terminal.
here is the script:
import gobject import dbus import dbus.glib import pygtk import gtk, math, os, time from dbus.mainloop.glib import DBusGMainLoop class Table: def __init__(self): dbus_loop = DBusGMainLoop() self.bus = dbus.SystemBus(mainloop=dbus_loop) go=0 margin = 500 while True : rawMceRequest = self.bus.get_object("com.nokia.mce", "/com/nokia/mce/request") self.mceRequest = dbus.Interface(rawMceRequest, dbus_interface="com.nokia.mce.request") orientation, standState, faceState, xAxis, yAxis, zAxis = self.mceRequest.get_device_orientation() if go==1: if abs(current) > abs(yAxis)+margin: self.roger(abs(yAxis)) current=yAxis time.sleep(.25) go=1 def roger(self,a): i=0 shake_list=range(100) print "+-+-+-+-+-+-" while i<100: orientation, standState, faceState, xAxis, yAxis, zAxis = self.mceRequest.get_device_orientation() shake_list[i]=(int(yAxis)) i+=1 z=sorted(shake_list) slope= [y - x for x, y in zip(z[:-1], z[1:])] print"current slope (",sum(slope)/99,")" if sum(slope)/100 > 35: os.popen("dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.next") print "skipped track at a slope of",sum(slope)/99 def main(): gtk.main() return 0 if __name__ == "__main__": Table() main()please test it out and tell me what you think about it
Last edited by m2cm2c; 2010-03-12 at 15:31. Reason: cleaned the script a little