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 Mon 22 Dec 2014, 22:59
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Is there another way to set wallpaper for the Rox desktop?
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 7 [104 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5043
Location: Arizona, U.S.A.

PostPosted: Sat 10 Aug 2013, 22:11    Post subject:  

I had discounted using PuppyPin, but I guess it is a hell of a lot easier.

I`ll rework WallPuppy one more time.
Back to top
View user's profile Send private message 
stu91


Joined: 06 Aug 2012
Posts: 145
Location: England. Dpup. Dell Inspiron 1501

PostPosted: Sun 11 Aug 2013, 01:02    Post subject:  

This has been my default rox wallpaper changer for a while now - maybe of some use?

Code:

#!/bin/sh
IFS=$'\n'
########################################################################
   if [[ ! -f $HOME/.twall ]]; then
   echo "DIR=/usr/share/backgrounds" >> $HOME/.twall
   echo "FORMAT=Stretch" >> $HOME/.twall   
   fi

   WALLDIR="` grep -i "DIR" $HOME/.twall | cut -d '=' -f2 `"
   FORMAT="` grep -i "FORMAT" $HOME/.twall | cut -d '=' -f2 `"

######################################################################## 
function WALLPAPER () { 
   echo ":: Current Wallpaper   > `cat $HOME/.config/wallpaper/bg_img` "
   echo ":: Current Directory   > $WALLDIR"
   echo ":: Current Format      > $FORMAT"
   select WALL in ` ls -1 "$WALLDIR/" | egrep ".jpg$|.png$" | sort ` "Quit" ;
   do
   
   if [[ "$WALL" = "Quit" ]]; then
   echo "Goodbye...." && exit
 
   elif [ ! -n "$WALL" ]; then
   echo "not a wallpaper....."
   #echo "Applying wallpaper - $WALLDIR/$WALL"
   else
   
   clear
   echo "Selected and applying > $WALL"
   
  rox --RPC << EOF
<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2001/12/soap-envelope">
 <env:Body xmlns="http://rox.sourceforge.net/SOAP/ROX-Filer">
  <SetBackdrop>
   <Filename>$WALLDIR/$WALL</Filename>
   <Style>$FORMAT</Style>
  </SetBackdrop>
 </env:Body>
</env:Envelope>

EOF
   echo "$WALLDIR/$WALL" > $HOME/.config/wallpaper/bg_img
   fi
   
  ## no icons puppy pin ##
 NOIWALL=`awk -F"[<,>]" '/<pinboard/ { getline; print $3 }' $HOME/Choices/ROX-Filer/noicon`
 sed -i "s:$NOIWALL:$WALLDIR/$WALL:g" /root/Choices/ROX-Filer/noicon
 
 #echo "Desktop Wallpaper > "$WALLDIR/$WALL" " | osd_cat -p "top"  -f "sans 15" -c "white" -d "8" -l "1" - &
 [[ -x "/usr/bin/notify-send" ]] && notify-send -t 5000 "Wallpaper > "$WALLDIR/$WALL" "
   
   done
}   

function HELP () {
   echo " :: Puppy Terminal wallpaper changer ::"
    echo " select the wallpaper to apply by number and press enter "
    echo " leave the input field blank and press enter to redraw list "
    echo ""
    echo "       -d  To change the current wallpaper directory"
    echo "       -f  To change  the wallpaper layout / format"
    echo "       -h  For help"
}   
########################################################################
    clear
   
    if [[ $# = 0 ]]; then
    WALLPAPER
   
    elif [[ $1 = -d ]]; then
    echo "Current Dir - $WALLDIR"
    read -p "Enter new wallpaper Directory: " NEWWALLDIR
    sed -i "s:"$WALLDIR":"$NEWWALLDIR":g" $HOME/.twall && exit
   
    elif [[ $1 = -h ]]; then
    HELP
   
    elif [[ $1 = -f ]]; then
    echo "Current Format - $FORMAT"
    echo "Enter new wallpaper Format:"
    select NEWFORMAT in "Stretch" "Scale" "Tile" "Center" "Quit" ; do
   
     if [[ "$NEWFORMAT" = "Quit" ]]; then
     echo "Goodbye...." && exit
     
     elif [[ -n "$NEWFORMAT" ]]; then
     sed -i "s:"$FORMAT":"$NEWFORMAT":g" $HOME/.twall && exit
     else
     echo "not a format...."
     fi
   
    done
    fi
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5043
Location: Arizona, U.S.A.

PostPosted: Sun 11 Aug 2013, 01:23    Post subject:  

Hi stu91; Others here were talking about your script. so I downloaded it.
But the gzip file was corrupt, probably just a bad download, crap happens...

I`ll look at your code further, WallPuppy was a doodle to show NathanF.

Thanks for being a Puppy member.! Terry
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2621
Location: www.eussenheim.de/

PostPosted: Sun 11 Aug 2013, 04:36    Post subject: Re: Is there another way to set wallpaper for the Rox desktop?  

L18L wrote:
... rox -p
(that is what setwalle does and what GUI pwallpaper does)


Apologies for having shot too fast Embarassed

rox -p .... is one way

but the other is different

pwallpaper (see http://bkhome.org/blog2/?viewDetailed=00181)
has a function setBG which is immediately showing the new background-image.

I don't understand how it works but here it is:
Code:
void setBG()
{
   
   FILE *file;
   gchar command[2500];
   g_print(_("Using the program %s.\n"), program);
   strcpy(command, "");
   strcpy(command, program);
   strcat(command, " ");
   switch (currentOption)
   {
      case 0:
          file = fopen("/root/.config/wallpaper/backgroundmode","w+");
          fprintf(file,"%s","Stretch");
           fclose(file);
         break;
      case 1:
          file = fopen("/root/.config/wallpaper/backgroundmode","w+");
          fprintf(file,"%s","Centre");
           fclose(file);
         break;
      case 2:
          file = fopen("/root/.config/wallpaper/backgroundmode","w+");
          fprintf(file,"%s","Tile");
           fclose(file);
         break;

   }
   strcat(command, " ");
   if (filename[0] != '\0')
   {
      strcat(command, filename);
      system(command);
      remove("/root/.config/wallpaper/bg_img");
   }
   return;
}
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2621
Location: www.eussenheim.de/

PostPosted: Sun 11 Aug 2013, 04:58    Post subject: Is there another way to set wallpaper for the Rox desktop?
Subject description: yes: set_bg
 

L18L wrote:
I don't understand how it works

Reading the sources can help also if you think to have no idea about C
Code:
      strcpy(program, "/usr/sbin/set_bg");


and/or just the comments:
Code:
//pwallpaper.c
//Copyright(c) 2009 G Pearson
// Puppy Wallpaper Setter
// Puppy Linux v 2-5
// 100704 BK: set_bg script now at /usr/sbin (in Woof).
// 130314 L18L internationalized v.1.2


Code:
MODE="`cat $HOME/.config/wallpaper/backgroundmode`"
[ "$MODE" = "" ] && MODE="Scale"
[ "$MODE" = "Centred" ] && MODE="Centre"
[ "$MODE" = "Scaled" ] && MODE="Scale"


SOLVED?
Back to top
View user's profile Send private message 
L18L

Joined: 19 Jun 2010
Posts: 2621
Location: www.eussenheim.de/

PostPosted: Sun 11 Aug 2013, 05:12    Post subject: Re: Is there another way to set wallpaper for the Rox desktop?  

sunburnt wrote:
I cannot figure out what the 2 <env: tag lines do.
Why are 2 URLs needed to set new Rox wallpaper.?

http://en.wikipedia.org/wiki/XML_namespace
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 4468
Location: Gatineau (Qc), Canada

PostPosted: Sun 11 Aug 2013, 22:58    Post subject:  

Please see below for latest version. musher0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hello!

I think I have something...

This script will
* sort your (long) list of images alphabetically. I'm probably not the only one to have over
100 background choices! Smile

* create submenus from the list above to avoid screen overflow

* offer you to
    view
    edit or
    place the backdrop

This follows a logical sequence: we view the picture to evaluate if it will make a nice background, then we
sometimes adjust (edit) it to our needs, and when we are satisfied with our modified picture, we do the
"placing" itself.

* it is bilingual (French-English). If you do not have LANG=fr_something, it will show in English. Don't
worry about the French in the examples, the language will be English if you do not have a French
localization of your Puppy.
You can easily include other languages in the script in its "case" part. There are only a few words, so I
didn't think that a full-blown *.mo file was necessary.

* it integrates with sunburnt's earlier script. Only minor edits were needed to have the menu work in
sync with it.

* dependencies: only aemenu and ROX-Filer.

* includes a *.desktop file (BG-Setter.desktop), so it will show in the "Desktop" section of any jwm menu
(or icewm menu, etc.).

* the viewer works best with a single image viewer, such as qiv. Multiple-image viewers, such as gqview,
are not recommended because they partly duplicate what this menu does. It may confuse things.

* the menu "recurses". The cat comes back! Wink Cool Again this follows a logical process: a menu is
obviously not an application, but we want to stay with the operation until we've finished. AFAIK,
menu recursion is only possible with the "ae" menu, but I'll be glad to be proven wrong on this point,
because menu recursion is very handy at times.

Note: For the sake of simplicity, the menu / script recognizes only jpg and png images. Make sure to
rename or convert your jpeg or JPG, etc., pictures.

Constructive comments are welcome. You can edit it or improve it too, but I'd like to know about it in
this thread if possible. Thanks in advance.

Enjoy.

musher0
change-BG-0.4.pet
Description 
pet

 Download 
Filename  change-BG-0.4.pet 
Filesize  9.58 KB 
Downloaded  176 Time(s) 
change_BG-0.4-2.jpg
 Description   In this picture, the list of backdrops appears sorted alphabetically, and with options of what you want to do with the picture.
 Filesize   56.91 KB
 Viewed   270 Time(s)

change_BG-0.4-2.jpg

change_BG-0.4.jpg
 Description   If you want to change your backdrop, this is where you choose the backdrop style. You would normally want to do this beforehand.
 Filesize   7.67 KB
 Viewed   255 Time(s)

change_BG-0.4.jpg


_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Last edited by musher0 on Mon 12 Aug 2013, 21:01; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 5043
Location: Arizona, U.S.A.

PostPosted: Sun 11 Aug 2013, 23:46    Post subject:  

Hey musher0; NOTE: The xml script I got from NathanF`s wallpaper app., and he got it from somewhere else...

I looked at aemenu but can`t find any info. about the menu file format, so I couldn`t make it work
Looking at your script: BG-set4.sh gives me an idea, but no clear picture of making it work.

# I Wrote an icon menu in BaCon years ago, you may be interested in that, it auto. resizes the pics.
Format is:
(Menu Item Text):[/Path/](Exec.File):[/Path/](IconFile)

And the icon`s paths can be preset so the path isn`t needed.

### My main problem is modifying Rox`s XML code, sed will do it, but BaCon won`t.
And I don`t want a tiny script as a required dependency.
.
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 4468
Location: Gatineau (Qc), Canada

PostPosted: Mon 12 Aug 2013, 02:40    Post subject:  

sunburnt wrote:

> Hey musher0; NOTE: The xml script I got from NathanF`s wallpaper app., and he got it from somewhere else...

It's right under everybody's nose: Razz Rolling Eyes the model is in ROX Manual, Appendix C ! file://localhost/usr/local/apps/ROX-Filer/Help/rox.htm#soap

PS. What do I rectify the credits to, then? Something like a folk song, then?
"sunburnt, who picked it up from Nathan F, who learned it from anonymous, who modified it from a
template by Thomas Leonard (the author of ROX-Filer)" ?

It looks ridiculous written like that, but authorship is a very serious issue.
Ideas, or experience about this, anyone ?

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Last edited by musher0 on Mon 12 Aug 2013, 08:42; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 4468
Location: Gatineau (Qc), Canada

PostPosted: Mon 12 Aug 2013, 02:49    Post subject:  

Hello, sunburnt.

sunburnt wrote:

I looked at aemenu but can`t find any info about the menu file format, so I couldn`t make it work
Looking at your script: BG-set4.sh gives me an idea, but no clear picture of making it work.
(...)


Euh... it's a dynamic menu. You'll find the realized menu after you've run the script. Load /tmp/BG.menu in your text editor and you'll see. I mean: try it! Don't just look at it! Smile (I'm not telling you what is aemenu's file format on purpose!) Smile Hint: dig up aragon's work on spm (Simple Puppy Menu) on this forum.

Edit: aemenu is part of the aewm window manager, (c) 1998-2007 by Decklin Foster. Please see
http://en.wikibooks.org/wiki/Guide_to_X11/Window_Managers/aewm and http://www.red-bean.com/decklin/aewm/.

sunburnt wrote:

### My main problem is modifying Rox`s XML code, sed will do it, but BaCon won`t.

Then don't modify it! Wisdom is finding a way to live peacefully with your problem| (Pardon the philosophical bit!) BTW, replaceit or replace can be used as well.

sunburnt wrote:

And I don`t want a tiny script as a required dependency.

Oh well...

Best regards.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 5043
Location: Arizona, U.S.A.

PostPosted: Mon 12 Aug 2013, 11:48    Post subject:  

The BaCon author pjot upgraded several of BaCon`s string replacement commands.
So now it parses XML and HTML fine!

I`m working on a custom Filer dialog for it, I`ll post the files soon...
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 4468
Location: Gatineau (Qc), Canada

PostPosted: Mon 12 Aug 2013, 16:01    Post subject:  

sunburnt wrote:
The BaCon author pjot upgraded several of BaCon`s string replacement commands.
So now it parses XML and HTML fine!

I`m working on a custom Filer dialog for it, I`ll post the files soon...


Great! Keep at it, man! Very Happy

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
Back to top
View user's profile Send private message Visit poster's website 
musher0


Joined: 04 Jan 2009
Posts: 4468
Location: Gatineau (Qc), Canada

PostPosted: Mon 12 Aug 2013, 20:42    Post subject:  

Hello again, folks!

Refined version BG-set0.5

Quote:
# 13 August 2013: added "Linguistic Correction" (FR and ES);
# studied and dismissed the possibility of an integrated function (see below);
# made the script work from $MBINS.
####

# An integrated function, for ex.,
# function placefond {}
# is not advisable since it's aemenu proper which
# takes over after this script has created the menu:
# this script is inactive at time of actual menu execution.


Enjoy!

musher0
change-BG-0.5a.pet
Description  This one has the correct *.desktop file. Everything else is the same.
pet

 Download 
Filename  change-BG-0.5a.pet 
Filesize  9.86 KB 
Downloaded  164 Time(s) 
BG-setter-0.5.desktop.tar.gz
Description  If you need the *.desktop file separately... (to the person who downloaded earlier)
gz

 Download 
Filename  BG-setter-0.5.desktop.tar.gz 
Filesize  351 Bytes 
Downloaded  164 Time(s) 

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)
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 14 Aug 2013, 15:47    Post subject:  

Was poking around and found this. Thought I'd clarify - I got the idea for how to change the ROX pinboard background by reading the ROX-Filer manual, simple as that.

Also, in case people aren't aware, I've been working on an almost scratch rewrite of the old wallpaper setter I codged together years ago. Fairly nice already but I have ideas for another direction it might go. In other words it's a wip and not expected to remain stable in it's current form.

_________________
Bring on the locusts ...
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger 
sunburnt


Joined: 08 Jun 2005
Posts: 5043
Location: Arizona, U.S.A.

PostPosted: Wed 14 Aug 2013, 23:43    Post subject:  

Good to hear Nathan.
Bounce a few of your ideas off of us for the heck of it.!

I`m working on a script to compile a BaCon file and build an AppPkg.
This so BaCon code can become portable to any compatible Linux.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 7 [104 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6, 7 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.1277s ][ Queries: 12 (0.0186s) ][ GZIP on ]