Desktop Background Changer

Karamba & Superkaramba

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
Score 50.0%
Description:

Desktop background changer
Created by strider

Depends on the Python Imaging Library (PIL)

Except if there are bugs, which there hopefully will not be, or perhaps a few new backgrounds, this should be the last version. In other words, I can't think of anything else I'd like to add.

NOTE: Do not overwrite versions below 1.6 - they don't store files locally. You'll have to readd the files sorry.

This is a karamba applet to easily change your background with one click to a picture from a list you make. It's not very functional, it's pure eyecandy, but it's quite fun! It stores the files locally and creates a thumbnail of the file in BMP format for fast loading. This means that if you delete or move the actual file the theme will still display its local copy.

To start off with you have a blank slate and you have to add images to the list, otherwise there's none to select! To add images right click the widget and move to Configure theme and click Add Image. First select an image (or several using the control button) and then select the position you want the image to be displayed when the widget puts it as the background image.
Once you've added an image a thumbnail of the image pops up and you can click it. Once you click it the desktop background becomes that image.

You can easily scroll up or down the list using the up or down arrows or the mouse scroll wheel. You can't drag the scroll bar unfortunately. To change the background right click > configure > Change background. The default theme is a blue console type theme. At the moment it's also got the cynapses background simply because I use cynapses on my desktop and it goes really well.

To remove an image do right click > configure > Change background. I'll try to make a dialog that can easily remove and move the order of images if I have the time and motivation (which I don't yet!) For the moment this is the final product.
Anyways, have fun with it. If you improve it at all pretty please send me a copy of what you've done! If you have a suggestion please post below - I'll check the comments every day or two for a while.

You can change the number of rows and columns using the configuration menu. You'll need a new background for the new number of rows or columns, but it will automatically adjust everything for you. You can easily change the entire layout of the theme by editing the variables up the top of the file.

The script file is pretty well commented. If you want to change anything it should be pretty easy to see what's what. The entire layout of the theme can be modified using the variables near the top of the script.

================================
Desktop Background Changer
Version 1.6
Created by strider
Get it from kde-look.org
================================
Last changelog:

14 years ago

1.6
- Fixed: Bug with the scrollbar - forgot about a case with a divide by zero, sorry.
- Fixed: --multiple error where karamba sometimes gives the filenames in parts giving feedback for several lines at a time. That's accounted for now.
- Added: The theme now stores the files locally, creating a thumbnail in the thumbnails directory and storing the image in the images directory.
- This theme now depends on the Python Imaging Library (PIL)

1.5.1
- Fixed: Badly placed scrollbar - it also gave a crash when putting the number of rows to 1. That's all better now - sorry!

1.5
- Fixed: Displaying no background if the background file is deleted. Background reverts to default
- Fixed: Processing an image if the file doesn't exist. Skips invalid images
- Added support for choosing the position of the background
- Backwards compatability for desktopbackground_images.txt has been broken - please follow the directions at the top of this readme

1.4
- Added support for changing the number of rows and columns
- Added general variables for the layout of the theme
- Changed it so you can scroll to one bar of empty space. This feels better in my humble opinion.

1.3
- Added support for removing images
- Added support for adding multiple images at once
- Added full commenting to the script file
- Changed all command line output to be prefixed with "Desktop Background Changer: "

1.2
- Added scroll wheel support - use a mouse scroll wheel to scroll the images up and down
- Added a position bar at the side to see what position you are in in the list of images

1.1
- Fixed: Change background changes the background without reloading
- Changed the names of all files to now begin with the "desktopbackground" prefix.
- Added a new blue background that's now default.

1.0
- Initial Release

sasquatchdied

14 years ago

I'm always wasting CPU piddling about with kcontrol, I always end up changing backgrounds on a whim and then changing my mind, this is just what I need

Report

johnc

14 years ago

I have over 300 images and one handy feature would be to have the image name displayed via a mouse over on the image. This would also make deleting the image very convenient.

Report

C

striderstrahan

14 years ago

sorry but superkaramba won't let me do that with this theme. I can't even make it show it normally at the bottom when you hover the mouse over the picture without killing the CPU (it'd do mediumly complex calculations with every mouse move). I could make it display the image name under the picture if you want but it'd not like really long image names - they'd overlap...

Report

johnc

14 years ago

A right mouse click will give you the configuration menu. Perhaps a wheel click, ie center button click, on the image, would yield another dialog box with the name of the image.

Report

johnc

14 years ago

I added the python library. When I try to add any image besides a jpg, the program refuses to import it. Won't import gif's or png's. Do I need to tweak the python library settings???

Report

C

striderstrahan

14 years ago

hmm it works for me. Perhaps you have a really old version of the PIL. What distro do you have?

Report

johnc

14 years ago

I have SUSE 9.2 and the PIL version 1.1.5.

Report

johnc

14 years ago

I like all your changes. When I tile an image, the desktop is black around the widget, so it looks like a shadow. When you scale an image, this doesn't happen. When I change to different columns and rows, the widget does not resize itself, so the images display themselves outside the widget.

Report

C

striderstrahan

14 years ago

hi,
First one is a bug in superkaramba it seems. I've got the same problem but it does exactly the same thing with other themes going through the KDE control panel.

For the second one, I haven't made the background automatically resize to the width and height. To do this you have to add two lines. Firstly on line 123 of the script add a new line after the karamba.createImage call:

karamba.resizeImage(widget, backgroundid, width, height)

To make it so it automatically resizes the new background when you change it add the same line at what's now line 315 before the redrawWidget line. To make it so it automatically resizes the background when you change the number of rows or columns add the same line on line 389 before updateImages(widget).

I didn't make it resize the background mostly because it looked better without it resized with cynapses on my desktop.

Report

johnc

14 years ago

I got the shadowing to go away by "center tiling" the image, instead of "tiling" the image. Thanks for the sizing info...I'll try it.

Report

C

striderstrahan

14 years ago

Do people think it'd be better to copy the image files to the theme directory? An advantage of this would be it wouldn't be susceptable to deleting the images and I could make thumbnails of the images for faster loading times and lower memory usage. But it'd take space and make a bit of clutter. It'd also require the Python Imaging Library as a dependency. I'm on holidays and it'd be extraordinarily easy to do, so anyone want me to do it?

Report

trinket

14 years ago

...but i have a little problem, my system not accept the --multiple in kdialog parameter.

I have Suse 9.2 with stock kde 3.3.0 and i think this is supported since kde 3.2.x

I dont know... :-(

someone has ideas?

Report

C

striderstrahan

14 years ago

You can safely remove the --multiple from the kdialog command string. Just remove it from the list.

All it does is make it so you can add many images by using the control button, but it's not necessary if you only want to add one image, kdialog just won't let you use the control button to select many.

The command string is about three quarters of the way down by memory. It's in a big list. Come to think of it, just search for "--multiple" :)

If you *really* want to select many images you can try updating your system, not sure what packages need to be updated though for Suse (I use Debian).

Report

johnc

14 years ago

Great idea...Some quick suggestions come to mind...Add the capability to scroll up and down with the mouse wheel or a scroll bar to allow faster browsing when adding lots of images...Store the images in directories that indicate their display characteristics...ie "tiled", "centered", or "scaled"...have your code parse the directory name, store it in a string variable, and display the image via your dcop statement, based on the string variable. You could use an "if, then" or "Select Case" statement in your Python script to accomplish this.

Report

C

striderstrahan

14 years ago

Added the scroll wheel support - good idea. I was actually going to do it before but naturally forgot about it.

I don't really want to store the files locally. It's a waste of space and clutters the directory. I'll perhaps add support for tiles etc but I *do* have a test in twelve hours so you'll have to wait about sixteen hours for that. The status of the thing will be stored locally in the file though. If you really want it to locally store the files I'll perhaps add it as an option or an easily changable variable in the script...

Report

14 years ago

1.6
- Fixed: Bug with the scrollbar - forgot about a case with a divide by zero, sorry.
- Fixed: --multiple error where karamba sometimes gives the filenames in parts giving feedback for several lines at a time. That's accounted for now.
- Added: The theme now stores the files locally, creating a thumbnail in the thumbnails directory and storing the image in the images directory.
- This theme now depends on the Python Imaging Library (PIL)

1.5.1
- Fixed: Badly placed scrollbar - it also gave a crash when putting the number of rows to 1. That's all better now - sorry!

1.5
- Fixed: Displaying no background if the background file is deleted. Background reverts to default
- Fixed: Processing an image if the file doesn't exist. Skips invalid images
- Added support for choosing the position of the background
- Backwards compatability for desktopbackground_images.txt has been broken - please follow the directions at the top of this readme

1.4
- Added support for changing the number of rows and columns
- Added general variables for the layout of the theme
- Changed it so you can scroll to one bar of empty space. This feels better in my humble opinion.

1.3
- Added support for removing images
- Added support for adding multiple images at once
- Added full commenting to the script file
- Changed all command line output to be prefixed with "Desktop Background Changer: "

1.2
- Added scroll wheel support - use a mouse scroll wheel to scroll the images up and down
- Added a position bar at the side to see what position you are in in the list of images

1.1
- Fixed: Change background changes the background without reloading
- Changed the names of all files to now begin with the "desktopbackground" prefix.
- Added a new blue background that's now default.

1.0
- Initial Release

12345678910
product-maker Count: 4 Rating: 5.0
File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
*Needs ocs-url or ocs-store to install things
Details
license
version
1.6
updated Jul 04 2005
added Jun 27 2005
downloads 24h
0
page views 24h 1