You are not logged in.
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
Last edited by k3ttc4r (2011-01-25 15:03:05)
Offline
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?
Offline
Compositing is just complete overkill if all I want are some shadows on my panels
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...
Offline