I work in an office and every morning I switch on my computer and
connect the freerunner to the usb to charge up the battery. Over the
course of the morning the orange power button led changes to a blue to
indicate that the phone is fully charged.
I had this idea that instead of just sitting there with a black screen
that it'd be nice if when fully charged the phone would power up the
screen and turn into a small photo frame beside my computer. To that end
I had a look at neon.py last night and did some messing around to add a
"-p" option for play the slideshow and "-l" for loop the slideshow, at
present neon displays all the phots in a directory and then stops.
Random would be nice but that's another night's messing.
I'm a complete novice to Python so this might not be the best addition
you'll ever see but I'll attach the diff -cB old new in case anybody is
interested
Once that was done I edited my /etc/freesmartphone/oevents/rules.yaml to
set up a rule for what I wanted. There seemed to be a rule for the blue
light so I added to that rule:
while: PowerStatus()
filters: HasAttr(status, "full")
actions:
- SetLed("gta02_power_blue", "light")
- OccupyResource(Display)
- Command('neon -f -p -l ~/Pictures/*.jpg')
Rule didn't work :-( Still I was Free to try it ;-)
*** orig.py 2009-09-24 08:59:24.000000000 +0100
--- neon.py 2009-09-24 08:59:46.000000000 +0100
***************
*** 587,592 ****
--- 587,595 ----
self.gui.part_object_get('viewer-navbar:slideshow').on_mouse_down_add(self.__toggle_slideshow)
self.navbar_timer = None
+ if self.gui.options.play:
+ self.__start_slideshow(False)
+
def mouse_move_cb(self, o, ev):
if not self.is_open:
return
***************
*** 715,721 ****
return True
def __open_next_image(self, obj=None, signal=None, source=None):
! if self.opened_img_index < len(self.gui.fsb.images) - 1:
self.opened_img_index += 1
else:
self.__stop_slideshow()
--- 718,726 ----
return True
def __open_next_image(self, obj=None, signal=None, source=None):
! if self.gui.options.loop and self.opened_img_index == len(self.gui.fsb.images) - 1:
! self.opened_img_index = 0
! elif self.opened_img_index < len(self.gui.fsb.images) - 1:
self.opened_img_index += 1
else:
self.__stop_slideshow()
***************
*** 1246,1251 ****
--- 1252,1261 ----
op.add_option("-d", "--bars-disappear-delay", metavar="DELAY",
default="0", type="float",
help="auto-hide delay for navbar and toolbar [sec], default=%default")
+ op.add_option("-p", "--play", action="store_true", default=False,
+ help="start in slideshow mode")
+ op.add_option("-l", "--loop", action="store_true", default=False,
+ help="loop the slideshow in directory")
options, args = op.parse_args()
options.auto_rotate = options.auto_rotate == '1' and options.auto_accel_rotate != '1'
_______________________________________________
devel mailing list
[email protected]
https://lists.openmoko.org/mailman/listinfo/devel