Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 20 Dec 2014, 16:53
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
fast and small Desktop-Backgroundsetter -Major upgrade-
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [44 Posts]   Goto page: 1, 2, 3 Next
Author Message
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Fri 07 Apr 2006, 02:20    Post subject:  fast and small Desktop-Backgroundsetter -Major upgrade-  




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

* 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/Puppybackgroundmenu/Puppybackground.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:
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, 10:54; edited 12 times in total
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Fri 07 Apr 2006, 03:19    Post subject:  

...
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Tue 18 Apr 2006, 09:17    Post subject:  

I added a verision, that shold be able to replace xli now.
Description see first message.
Mark
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Wed 19 Apr 2006, 06:07    Post subject:  

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
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Wed 19 Apr 2006, 19:56    Post subject:  

Finished the new grafical interface, see first message Smile

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
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Wed 19 Apr 2006, 20:38    Post subject:  

uploaded it again, with just 2 backgrounds it was too fast, and did not close the "percentagebar"-window Laughing
Mark
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7099
Location: Perth, Western Australia

PostPosted: Wed 19 Apr 2006, 22:50    Post subject:  

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...
jwmconfig-0.1patched.tar.gz
Description 
gz

 Download 
Filename  jwmconfig-0.1patched.tar.gz 
Filesize  21.22 KB 
Downloaded  274 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Wed 19 Apr 2006, 23:05    Post subject:  

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

Greets, Mark
Back to top
View user's profile Send private message Visit poster's website 
Nathan F


Joined: 08 Jun 2005
Posts: 1760
Location: Wadsworth, OH (occasionally home)

PostPosted: Wed 19 Apr 2006, 23:42    Post subject:  

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 ...
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger 
Melmo

Joined: 26 Sep 2005
Posts: 18

PostPosted: Thu 20 Apr 2006, 00:20    Post subject: Wow looks awesome  

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
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7099
Location: Perth, Western Australia

PostPosted: Thu 20 Apr 2006, 05:57    Post subject:  

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.
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Thu 20 Apr 2006, 08:21    Post subject:  

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, 11:19; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Thu 20 Apr 2006, 08:34    Post subject: Re: Wow looks awesome  

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
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Thu 20 Apr 2006, 11:10    Post subject:  

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:
#-------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
Back to top
View user's profile Send private message Visit poster's website 
Nathan F


Joined: 08 Jun 2005
Posts: 1760
Location: Wadsworth, OH (occasionally home)

PostPosted: Thu 20 Apr 2006, 11:28    Post subject:  

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 ...
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger 
Display posts from previous:   Sort by:   
Page 1 of 3 [44 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0845s ][ Queries: 12 (0.0040s) ][ GZIP on ]