fast and small Desktop-Backgroundsetter -Major upgrade-

Stuff that has yet to be sorted into a category.
Message
Author
User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

fast and small Desktop-Backgroundsetter -Major upgrade-

#1 Post by MU »

Image


*******************************************************

* important update:

http://www.murga.org/~puppy/viewtopic.php?p=65305#65305

*******************************************************

This Backgroundsetter is very comfortable, it displays all Pictures in a list.
It has 5 Buttons to choose wheather to fit, stretch, center or tile a picture, or to use a colored background only.

The list is very fast, as it saves Thumbnails (previewpictures).
It also has an intternal Database, that recognizes when a picture was modified.
I'm not shure if the database works 100% correct, so please report if you find odd behaviour.

The whole program is 60 kb in size.
The hugest part is the grafical interface, the binary itself is just 8.3 kb!

Download (35 kb):
http://dotpups.de/dotpups/Desktop-Tools ... ground.pup

Tip
If you want, that your last chosen picture/color is displayed when X starts, add this command to /root/.xinitrc ,before the line "exec $CURRENTWM ":
Puppybackgroundmenu saved &

You also should delete these lines, to speed up the start of your Desktop:

Code: Select all

CURRENTBKGRND="`cat /etc/background| cut -f 2 -d ','`"
CURRENTREPMODE="`cat /etc/background| cut -f 1 -d ','`"
case $CURRENTREPMODE in
 replicate)
  xli -onroot -quiet $CURRENTBKGRND &
  ;;
 color)
  xsetroot -solid "$CURRENTBKGRND"
  ;;
 fullscreen) #try fill screen but keep proportions.
  xli -onroot -quiet -$CURRENTREPMODE $CURRENTBKGRND &
  ;;
 fillscreen) #totally fill screen, may not work high resolutions.
  xli -onroot -quiet -$CURRENTREPMODE $CURRENTBKGRND &
  ;;
 exactfit) #v1.0.7 resize any image to fill screen, with smoothing.
  fitimage2root $CURRENTBKGRND &
  ;;
esac
I also included all sourcecodes.

Mark
Last edited by MU on Sat 26 Aug 2006, 14:54, edited 12 times in total.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#2 Post by MU »

...

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#3 Post by MU »

I added a verision, that shold be able to replace xli now.
Description see first message.
Mark

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#4 Post by MU »

ok, before someone starts porting Puppys grafical backgroundsetter to this binary, please wait, as I am working on a new Gui written in C using Gtk.
Mark

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#5 Post by MU »

Finished the new grafical interface, see first message :)

Barry and Nathan, if it is reported to run stable, here some tips for integration into a Puppy-iso:
Files of Puppybackground:
/usr/local/bin/Puppybackgroundsetter (8.3 kb)
/usr/local/Puppybackground/ (51 kb without sources)



The following can be removed:

/usr/sbin/fitimage2root (1.3 kb)
/usr/sbin/set-bkcolor (1.3 kb)
/usr/sbin/set-bkgrnd (1.9 kb)
/usr/local/bin/xli (248 kb)
/etc/background
/usr/local/Puppybackground/source (32 kb)

Replace the following lines in .xintrc with this one:
/usr/local/Puppybackground/Puppybackgroundmenu saved &

-------------------------------------

CURRENTBKGRND="`cat /etc/background| cut -f 2 -d ','`"
CURRENTREPMODE="`cat /etc/background| cut -f 1 -d ','`"
case $CURRENTREPMODE in
replicate)
xli -onroot -quiet $CURRENTBKGRND &
;;
color)
xsetroot -solid "$CURRENTBKGRND"
;;
fullscreen) #try fill screen but keep proportions.
xli -onroot -quiet -$CURRENTREPMODE $CURRENTBKGRND &
;;
fillscreen) #totally fill screen, may not work high resolutions.
xli -onroot -quiet -$CURRENTREPMODE $CURRENTBKGRND &
;;
exactfit) #v1.0.7 resize any image to fill screen, with smoothing.
fitimage2root $CURRENTBKGRND &
;;
esac
-------------------------------------





Mark

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#6 Post by MU »

uploaded it again, with just 2 backgrounds it was too fast, and did not close the "percentagebar"-window :lol:
Mark

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#7 Post by BarryK »

Okay, I've created a Unleashed package, see Developer News page.

However, there is one problem, as thoughtjourney's JWM Configuration package
calls set-bkgrnd. Maybe also reads /etc/background -- not sure about that.
Thoughjourney is not available -- having, or has already had, a baby.

I've attached her Unleashed package -- Mark, would you mind scanning thru
this and changing the appropriate lines? --- it's just that you are more familiar
with the new background setter so will know exactly what to do.
Her scripts are simple bash/ash, using gtkdialog.

jwmconfig Unleashed pkg attached...
Attachments
jwmconfig-0.1patched.tar.gz
(21.22 KiB) Downloaded 385 times

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#8 Post by MU »

ok, will have a look tomorrow, I'm too tired now.

Greets, Mark

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#9 Post by Nathan F »

Looks like very goodwork, I'll do some testing with it tommorrow before work. Looks perfect for Puppy and a big improvement over the old setter.

Your contributions are getting to be really numerous, thanks.

Nathan
Bring on the locusts ...

Melmo
Posts: 18
Joined: Mon 26 Sep 2005, 08:25

Wow looks awesome

#10 Post by Melmo »

Wow mu that looks awesome.

im just wondering how easy it would be to extend that concept to a picture manager something like picasa?

very cool, your doing some amazing stuff

Melmo

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#11 Post by BarryK »

Just recalled a bit more. Thoughtjourney's program applies themes that integrate GTK and JWM. There are shell scripts that change /etc/background, then execute xli to apply the new background immediately -- if you poke around in the
package, easy to find those scripts.

But, it looks like you need to be able to run your backgroundmenu program from
the commandline to set a new background image, that is, the new image has to
be a commandline parameter. Then, run with the "saved" parameter to apply it.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#12 Post by MU »

you can run
/usr/local/Puppybackground/resource/puppybackgroundsetterwrapper (i call it xxx now to keep the instruction better readable).

It will update /etc/Puppybackgroundcolor (Puppybackgroundpicture) and set the changes immedeatly.
It also updates /etc/background for backward-compatibility.

usage:

- show a colordialog, save the chosen one to the config and apply it::
xxx -colorselect

- set a color
xxx -color "#FF0033"
xxx -color 255 0 40
xxx -color rgb:FF/66/00

- read the colorconfig, and apply it together with a picture (and save this choice to /etc/Puppybackgroundpicture):
xxx -fit thepic
xxx -stretch thepic
xxx -center thepic
xxx -tile thepic

You also could call Puppybackgroundsetter (the C-binary) directly, but that would not update/read the config in /etc.
So I wrote this small wrapper, that takes care of that.

Mark
Last edited by MU on Thu 20 Apr 2006, 15:19, edited 2 times in total.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

Re: Wow looks awesome

#13 Post by MU »

Melmo wrote: im just wondering how easy it would be to extend that concept to a picture manager something like picasa?
I don't know picasa.
My program is very fast, because it uses only one directory, that allows to keep it simple.
A universal tool (where you could choose other folders) would need a more complex database, to keep the speed.

I first thought of adding some options to flip/rotate images, as it can be done easily with the imlib-library.
But we already have Gtksee/GQView, that allow this too, together with a fullscreen-slideshow and a tree for navigation in different folders.
So I actually see no need for it.

I think it might make more sense, to write some comandlinetools to scale/flip pictures.
They could use the "convert" (ImageMagick)-syntax, so you could do batch-processing, without installing the huge ImageMagick -lbrary ( http://www.murga.org/~puppy/viewtopic.php?t=3894 ).

Mark

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#14 Post by MU »

I updated the Dotpup.

Changes:

--------------------------------------------------
there was a bug with the colorchooser.
I fixed it, and have set more options to puppybackgroundsetterwrapper.

To run it with the colorselector:
puppybackgroundsetterwrapper -colorselect

To set a colour:
puppybackgroundsetterwrapper -color "#FF0033"
puppybackgroundsetterwrapper -color 255 0 40
puppybackgroundsetterwrapper -color rgb:FF/66/00

The last one is the "native" format of the C-binary.

The wrapper now also updates /etc/background for older programs, that still use it.

Note, I had to replace "buttons.rc", too.
--------------------------------------------------
New: /usr/local/xlipuppy

This is a "translator", using the xli-commands used in Puppy in the past (only those, not all xli-options).
It runs my wrapper then with the translated options.
--------------------------------------------------
Update of Puppy-systemfiles

You have a new folder Oldpuppy. You can copy the files in it to your system, if you like.
They are not "installed" by default.

It contains rewritten scripts:
1.) set-bkcolor
2.) set-bkgrnd
3.) fitimage2root
These call the wrapper or the grafical interface now.

4.) jwmThemeSwitcher

I added a Patch (3 lines):

Code: Select all

#-------Patch from Mark Ulrich , replace xli with xlipuppy-------->>

cat "/root/.jwm/themes/bg-$CHOICE" | sed "s/xli /xlipuppy /g"> "/root/.jwm/themes/bg-$CHOICE-MU"
cat "/root/.jwm/themes/bg-$CHOICE-MU" > "/root/.jwm/themes/bg-$CHOICE"
rm -f "/root/.jwm/themes/bg-$CHOICE-MU"
So when you choose a Theme, the theme is "rewritten", replacing "xli" with "xlipuppy".
So it takes advantage of the new backgroundsetter.

Mark

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#15 Post by Nathan F »

Okay, I've gotten the jwmconfig utility to call Mark's backgroundsetter program when you click the Desktop Color and Desktop Background buttons. I'm working on getting it to work with the jwm themes now. Shouldn't be too hard with MU's excellent instructions.

Nathan
Bring on the locusts ...

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#16 Post by Nathan F »

Ha! He beat me to it again. Thanks.

Nathan
Bring on the locusts ...

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#17 Post by Nathan F »

Here it is in unleashed format, with the wrappers in place to replace the old scripts.

Nathan
Attachments
puppybackground.tar.gz
(29.32 KiB) Downloaded 238 times
Bring on the locusts ...

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#18 Post by MU »

I uploaded a new version.

Changes:

You now have a file:
/usr/local/Puppybackground/resource/roxrestart.sh-deactivated

If you have the Rox 2.4 Desktop, rename it to
/usr/local/Puppybackground/resource/roxrestart.sh

Then this happens:

The current Backgroundpicture will be saved (iincluding all modifications like tiling and backgroundcolor ) as
/root/Choices/ROX-background.jpg

Choose it once as Desktop-background in Rox (Right -click an icon - Backdrop).
Now the Backgroundsetter sets this always overwritten Picture automatically in Rox 2.4 as Desktopbackground.

Mark.
Last edited by MU on Thu 20 Apr 2006, 20:56, edited 1 time in total.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#19 Post by MU »

Uploaded again, the last update forgot to free memory in stretch.c :oops:
Files affected: /usr/local/bin/Puppybackgroundsetter
Corrected now.
Mark

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#20 Post by MU »

Uploaded again.
It was stupid to save the picture for Rox in /usr/share backgrounds, as this forces the menu to regenerate the thumbnail for it at every start.
I use /root/Choices now.
Mark

Post Reply