You are not logged in.

#1 2011-01-25 11:03:41

k3ttc4r
Member
From: around somewhere
Registered: 2008-12-28
Posts: 137
Website

gempaper - shadow generating wallpaper changer

My very first Ruby script.
Unfortunately only after I put it on Github I realized I should have called it papergem.

So, I like to have shadows on my panels, and I like to change my wallpapers a lot. The solved the first problem by adding shadow to my wallpaper in Gimp. But since I'm way to lazy to do that everytime I want to change the wallpaper, I wrote a script that does it for me.

It's pretty simple, actually. What it does - it takes an image (either specified via CLI argument, or random from a directory), resizes it to fit the screen's resolution, and adds a pre-made .png containing shadows to it. Then it saves the new image, and sets it as wallpaper via feh. BAM!

Also, it can list and preview available images.

As mentioned above, it's my first Ruby script, so it might not be too elegant. But it works. Any critique is welcomed, though.

I'm also thinking about ways to make this a little smarter, too. I was thinking something along the lines of having it figure out a good shading for the shadow, depending on brightness of the wall, and maybe being able to tell it to set a light/dark wallpaper, and it would randomly choose a light/dark one. Maybe even extend that to colors. But I'm afraid that would require a database to keep image information, otherwise it might take too long if it has to scan all images every time it's started.

Needs:
Ruby, RMagick, feh

Get it on Github

Screenshot:
2011-01-25_23-06-thumb.png

Last edited by k3ttc4r (2011-01-25 15:03:05)


arch64   ||   github | dotshare | blog

Offline

#2 2011-01-25 13:31:23

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: gempaper - shadow generating wallpaper changer

Neat! That sounds like a smart and easy way to add shadows to your user interface without needing a compositing window manager.

Will you please post a screenshot? smile

Offline

#3 2011-01-25 15:07:40

k3ttc4r
Member
From: around somewhere
Registered: 2008-12-28
Posts: 137
Website

Re: gempaper - shadow generating wallpaper changer

Compositing is just complete overkill if all I want are some shadows on my panels big_smile

First post updated with screenshot. I thought I didn't need one, since it's a CLI app. I don't have a LOT of shadows, but if you look close enough, you will see them.


Also, I just remembered that I can actually draw using [Image|R]Magick, so I guess I'll have to update the script to draw them by itself, instead of still having to use Gimp to create an overlay...


arch64   ||   github | dotshare | blog

Offline

Board footer

Powered by FluxBB