moving wallpaper
Marco Martin
notmart at gmail.com
Sun Jan 24 14:38:29 CET 2010
On Saturday 23 January 2010, Aaron J. Seigo wrote:
> On January 23, 2010, andreas wrote:
> > So what i did is simple. I took a still image, made it seamless and
> > doubled its height. Than i needed only 20 lines of code to make it
> > slowly move from top to bottom of my desktop.
>
> nice :)
>
> > I created a timer with 10 ticks per second and
> > called a repaint when it hit to show the wallpaper with an offset that is
> > simply controlled by the timer.
> >
> > It is simple and beautiful and adds allot to the desktop experience.
> >
> > But i have questions about it :
> >
> > - is there anything like that already done or planned
>
> there are a few animated wallpapers. personally, i have thought about
> creating a javascript driven wallpaper plugin that would let you choose an
> svg and control the elements in them using simple javascript. so, for
> instance, you might do:
>
> =====
>
> var pos = rect().topLeft()
> var delta = 1;
> function move()
> {
> pos.moveBy(delta, delta)
> if (!wallpaper.rect().contains(pos)) {
> delta = delta * -1
> pos.move(delta * 2, delta *2)
> }
>
> element.move(pos)
> }
>
> var svg = wallpaper.load("mysvg") // an svg from the package
> var svgElement = svg.element("someSvgElementId")
> var element = wallpaper.addImage(animatedElement)
> wallpaper.setBackground(wallpaper.defaultImage())
>
> var timer = new QTimer
> timer.duration = 100
> timer.timeout.connect(move)
> timer.start()
>
> =====
>
> something like that, anyways... i really haven't though much about the API
> in detail. but such a system would give us a generic way to quickly create
> neat little dynamic wallpapers.
>
> including callbacks for mouse interaction (press, release, etc) and
> including bindings for things such as date and time, data engine and
> kinetic it would make this all very easy. we could even provide a standard
> "select the base image" config UI, perhaps.
>
> > - is there a better way to implement it, with less resource usage
> >
> > i have the proprietary amd driver installed on a 3 GHZ quadcore pc and
> > it
> >
> > uses 20% cpu
>
> if you are calling update(boundingRect()) then that wouldn't be much of a
> surprise, really, as it would be repainting the entire screen 10 time per
> second. since it's only 20 lines of code, perhaps you could include it as
> an attachment for us to look at?
eh, a scrolling wallpaper means repainting all the screen and all there is on
it, so also all plasmoids, this can only be tough.
i had the idea of doing a parallax scrolling one for the netbook thinghie but
never got arond to it because besides being 0 priority a) duplicating image
code makes me cringe (and some js scripting to the image one would help in
this case) b) can only be done in a spu sucking way right now, at east with
x11 and raster graphicssystem, even if -in theory- on x11 a screen-sized big
blitting should still be somewhat accetable.. (i guess n900 does that with
some kind of graphics acceleration)
Cheers,
Marco Martin
More information about the Plasma-devel
mailing list