Re: Timelapsed backgrounds



> Here is a slightly extreme idea. How about a dbus interface for
> changing the background? I guess all it should take is a path to an
> image and fade the background to it.

It's already trivially easy to change the desktop image with GConf. A
D-Bus interface wouldn't really make it any easier.

> I actually thought about this the other day as I wanted to have my IM
> application change the background to the person I'm talking to. I like
> pictures of family and friends as my background but I just never get
> around to changing it.

Interesting idea. It took me about five minutes to implement with
Python. ;-) The following script uses D-Bus to detect when a new Pidgin
window is created and then uses GConf to change the desktop background.
Just put a file with the screen name of each person in ~/.purple/bg and
it will work:

#!/usr/bin/env python

import os, gconf, dbus, gobject, dbus.glib

IMAGE_DIR = os.path.expanduser("~/.purple/bg")

bus = dbus.SessionBus()
obj = bus.get_object("im.pidgin.purple.PurpleService",
    "/im/pidgin/purple/PurpleObject")
purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")

def onConversationCreated(cId):
  fn = "%s/%s" % (IMAGE_DIR, purple.PurpleConversationGetName(
    cId).strip().lower().replace(" ", ""))
  if os.path.exists(fn):
    gconf.client_get_default().set_string(
        "/desktop/gnome/background/picture_filename", fn)

bus.add_signal_receiver(onConversationCreated,
  dbus_interface="im.pidgin.purple.PurpleInterface",
  signal_name="ConversationCreated")

gobject.MainLoop().run()

For more information about how to use the Pidgin D-Bus API, see my
tutorial here:

http://arstechnica.com/reviews/apps/pidgin-2-0.ars/4

--
Ryan Paul
Ars Technica News Desk

On Wed, 2007-09-26 at 18:19 +0200, Thomas H.P. Andersen wrote:
> Desktop backgrounds are boring. Even though it's damn easy to change
> the background few people I know do it regularly. (Mine usually only
> change when some jerk comes by and decides my new background should be
> goatse :-) ) Having the background change subtly over time sounds like
> a very nice feature to me.
> 
> Here is a slightly extreme idea. How about a dbus interface for
> changing the background? I guess all it should take is a path to an
> image and fade the background to it.
> 
> I actually thought about this the other day as I wanted to have my IM
> application change the background to the person I'm talking to. I like
> pictures of family and friends as my background but I just never get
> around to changing it. There is also an application to fetch
> interesting flickr pictures and put them as background as well. Having
> an easy interface to change it might spark even more innovative ideas
> too.
> 
> 
> On 26 Sep 2007 17:35:21 +0200, Soeren Sandmann <sandmann daimi au dk> wrote:
> > "Sanford Armstrong" <sanfordarmstrong gmail com> writes:
> >
> > > This sounds really cool!  Is there any support for for changing the
> > > background at a specific time of day?  That way you could show morning
> > > images in the morning, evening images in the evening, etc.
> >
> > Yes, this is exactly the intention.
> >
> > > I don't see how you could guarantee that with durations (as in the
> > > sample XML file), unless you always logged in at the same time every
> > > day.  ;-)
> >
> > The slides.xml file has:
> >
> > <starttime>
> > <year>2007</year>
> > <month>8</month>
> > <day>28</day>
> > <hour>12</hour>
> > <minute>21</minute>
> > <second>23</second>
> > </starttime>
> >
> > which means the first slide would be shown at that time. If the sum of
> > durations is 24 hours, then the cycle would start over at the same
> > time every day.
> >
> >
> >
> > Soren
> > _______________________________________________
> > desktop-devel-list mailing list
> > desktop-devel-list gnome org
> > http://mail.gnome.org/mailman/listinfo/desktop-devel-list
> >
> _______________________________________________
> desktop-devel-list mailing list
> desktop-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/desktop-devel-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]