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 Wed 22 Oct 2014, 21:42
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 1 of 7 [104 Posts]   Goto page: 1, 2, 3, 4, 5, 6, 7 Next
Author Message
sunburnt


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

PostPosted: Fri 09 Aug 2013, 00:05    Post subject:  Is there another way to set wallpaper for the Rox desktop?  

This sets the wallpaper by restarting the desktop, but doesn`t do stretch, tile, etc.:
Code:
rox -p /root/Choices/ROX-Filer/PuppyPin

This XML code does it, but it`s a real pain to use it directly in other languages.
Code:
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>$1</Filename>
   <Style>$MODE</Style>
  </SetBackdrop>
 </env:Body>
</env:Envelope>

EOF

I cannot figure out what the 2 <env: tag lines do.
Why are 2 URLs needed to set new Rox wallpaper.?
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Fri 09 Aug 2013, 12:00    Post subject:  

Hi.

Ah, I see you read the Appendix to the ROX manual! Smile

Add this before the above code, and you'll get a centered background by right-clicking on the picture.

Code:

#!/bin/sh
####

IFS='\n'
MODE="Centre"
echo $MODE > $HOME/.config/wallpaper/backgroundmode

(code in previous post goes here)


Change the MODE to "Scale" and you'll get a scaled background.

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: 5037
Location: Arizona, U.S.A.

PostPosted: Fri 09 Aug 2013, 12:48    Post subject:  

Thanks musher0; I`m hoping to find another way to do it other than XML.

The Center mode does not seem to work.

I modded the code to use cli args. for both /path/file and mode:
Code:
#!/bin/sh

[ "$2" = "Center" ] && MODE="Centre"

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>$1</Filename>
   <Style>$2</Style>
  </SetBackdrop>
 </env:Body>
</env:Envelope>

EOF
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Fri 09 Aug 2013, 13:10    Post subject:  

Hello, people!

For those who don't want to code anything, of course, there is always the longish way to do it.

First, un-tick the second item in the Options Compatibility list (see 1st pic).
Your window manager menu will be temporarily disabled.

Second, choose "backdrop" in ROX's right-click list.
Drag your picture in the box. (See 2nd pic.) Your new background
will place itself on the desktop automatically.

Finally, go back to ROX's Options panel, go to "Compatibility" tab, and re-tick the second item. A right-click on the background will now call your window manager menu, like previously.

It takes longer, but of course you're not supposed to change backgrounds every other minute.

Sorry for the French in the pictures. On an English system, the items' labels will be in English. Just follow the positions.

I hope this helps.

BFN.

musher0
Untick_Second_Item.jpg
 Description   
 Filesize   30.81 KB
 Viewed   405 Time(s)

Untick_Second_Item.jpg

Another_Way_to_Set_ROX_Background.jpg
 Description   
 Filesize   42.97 KB
 Viewed   458 Time(s)

Another_Way_to_Set_ROX_Background.jpg


_________________
"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 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
Location: Kiel,Germany

PostPosted: Fri 09 Aug 2013, 13:12    Post subject: Re: Is there another way to set wallpaper for the Rox desktop?  

sunburnt wrote:

Why are 2 URLs needed to set new Rox wallpaper.?

The Author on his way to world domination,
needs a backdoor URL to make ROX popup an icon to the USER to say "$USER , Pay 10,000$ or I'll nuke your partition table !"
Laughing
Back to top
View user's profile Send private message Visit poster's website 
musher0


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

PostPosted: Fri 09 Aug 2013, 13:54    Post subject:  

Hi, sunburnt.

I played around with your script and made it work with the following changes:

1) Try prefixing the image name with $PWD/. Something like
Code:
sunburntBG.sh $PWD/wallpaper-snow.jpg Centre


2) Also stick to the American English spelling of "Centre", not the British
one of "Center", or a mix of the two. Neither ROX nor bash know how to
spell! It seems that ROX uses the American spelling, so there is no point
in providing both spellings.

So here's your script again, edited:

Code:
#!/bin/sh
# /root/my-applications/bin/sunburntBG.sh
#
[ "$2" = "Centre" ] && MODE="Centre"
echo $MODE > $HOME/.config/wallpaper/backgroundmode

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>$1</Filename>
   <Style>$MODE</Style>
  </SetBackdrop>
 </env:Body>
</env:Envelope>

EOF


3) As a precaution, I've added the line:
Code:
echo $MODE > $HOME/.config/wallpaper/backgroundmode

as you can see.

4) As well, I did away with the $2 variable and substituted $MODE, which
you provide at the beginning of your script: I think it's clearer with $MODE.

Now your script works for me! Smile

Best.

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 
musher0


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

PostPosted: Fri 09 Aug 2013, 14:01    Post subject: Re: Is there another way to set wallpaper for the Rox desktop?  

Karl Godt wrote:
sunburnt wrote:

Why are 2 URLs needed to set new Rox wallpaper.?

The Author on his way to world domination,
needs a backdoor URL to make ROX popup an icon to the USER to say "$USER , Pay 10,000$ or I'll nuke your partition table !"
Laughing


Funny guy... Smile

Hint Wink : make a backup of your fstab if you know Karl_Godt is going
to be around! (And of everything in your Puppy, while you're at it!) Razz

I hope the smileys are showing properly at your end?! Laughing Cool
(This is a joke!)

Have fun!

_________________
"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: 5037
Location: Arizona, U.S.A.

PostPosted: Fri 09 Aug 2013, 14:10    Post subject:  

Thanks again musher0; This is being run from a BaCon app.
So it`s easiest to just feed script with cli arguments.
But for compatibility I also write the config. files in the BaCon app.

So actually the line should be: [ "$2" = "Center" ] && MODE="Centre"
But if I`m using cli args., then I`ll need to fix it in the BaCon app.

This seems to get all of the modes working; Stretch, Center, Tile, Scale.
.
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Fri 09 Aug 2013, 14:18    Post subject:  

Hello, again, sunburnt.

I don't know BaCon (except with eggs... or in a BLT sandwich) Smile
So can't help you there!

That said, with a direct cli,
line 12 of the script could have this:
Code:
   <Filename>$PWD/$1</Filename>


and one could use this simpler command instead:
Code:
sunburntBG.sh wallpaper-west.jpg Centre


Speaking of BLT sandwich, I'm hungry! Smile

BFN.

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 
R-S-H

Joined: 18 Feb 2013
Posts: 490

PostPosted: Fri 09 Aug 2013, 14:42    Post subject:  

To scripts to set Wallpaper from Openbox menu by stu90
I think (just hope so), the setwalle script can be used also to set specific wallpaper (setwalle YourWPHere) from within any other WM.

_________________
LazY Puppy Home
The new LazY Puppy Information Centre

Back to top
View user's profile Send private message 
musher0


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

PostPosted: Fri 09 Aug 2013, 17:53    Post subject:  

Hello, R-S-H.

That sure is a nice script from stu90. However, it is no good with ROX,
since ROX adds its own wallpaper layer.

Stu's script also needs feh as a dependency, which like qiv and a couple
of other background apps, set the second layer of background (the one
that conky sees when in transparent mode).

The first layer of background being set by BK's .xinitrc with this line:
Code:
[ -f /usr/bin/xsetroot ] && xsetroot -cursor_name top_left_arrow

through xsetroot (line 103 or thereabouts). It should be noted that
one cannot set a jpeg or png image as background with xsetroot,
only a xpm pattern. (That's a pretty old approach, if you ask me.)
But xsetroot is needed to define the cursor.

BFN.

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: 5037
Location: Arizona, U.S.A.

PostPosted: Sat 10 Aug 2013, 04:25    Post subject:  

Yeah, I`m guessing that only Rox does Rox.

So I`ll try to make the best of this...
Back to top
View user's profile Send private message 
R-S-H

Joined: 18 Feb 2013
Posts: 490

PostPosted: Sat 10 Aug 2013, 08:20    Post subject:  

Hi.

musher0 wrote:
That sure is a nice script from stu90. However, it is no good with ROX,
since ROX adds its own wallpaper layer.

Stu's script also needs feh as a dependency, which like qiv and a couple
of other background apps, set the second layer of background (the one
that conky sees when in transparent mode).

I don't know if there are some apps and/or dependencies needed (like feh and qiv). All I do know, is:

1. I do use this nearly daily, by now, for about one year or so, without any problems
2. I don't have feh installed (see the attached image)
3. I don't have qiv installed (see the attached image)
4. File Manager is ROX

And it works very well over here.

I did just made some modifications to refresh the PWidgets and WBar (because of them used background-parts).

Quote:
It should be noted that
one cannot set a jpeg or png image as background with xsetroot,
only a xpm pattern. (That's a pretty old approach, if you ask me.)
But xsetroot is needed to define the cursor.

As you can see in the third image:

I do use JPG files for wallpapers. PNG works also, but I did choose to use JPG only, because of its size.

This is no offend!

These are just the facts - over here, in LazY Puppy, based on Lucid 528-4!

RSH
image-1.jpg
 Description   There is no qiv installed
 Filesize   13.58 KB
 Viewed   334 Time(s)

image-1.jpg

image-3.jpg
 Description   There is no feh installed
 Filesize   18 KB
 Viewed   349 Time(s)

image-3.jpg

image-4.jpg
Description  JPG Images from /usr/share/backgrounds in Openbox menu
jpg

 Download 
Filename  image-4.jpg 
Filesize  128.94 KB 
Downloaded  193 Time(s) 

_________________
LazY Puppy Home
The new LazY Puppy Information Centre

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

Joined: 19 Jun 2010
Posts: 2525
Location: Moved from Hosla to www.eussenheim.de

PostPosted: Sat 10 Aug 2013, 09:47    Post subject: Re: Is there another way to set wallpaper for the Rox desktop?  

use sed -i to change style and image in the backdrop line
ex:
Code:
<backdrop style="Stretched">/usr/share/backgrounds/squiggles.jpg</backdrop>

and relaunch rox -p
(that is what setwalle does and what GUI pwallpaper does)
Back to top
View user's profile Send private message 
musher0


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

PostPosted: Sat 10 Aug 2013, 13:08    Post subject:  

My apologies, R-S-H and L18L.

I had focused on the rem'd feh part (it is thus only an option), and the following had escaped me.

Code:
### apply new wallpaper for rox-filer ###
     currentwall="`awk -F"[<,>]" '/<pinboard/ { getline; print $3 }' $HOME/Choices/ROX-Filer/PuppyPin`"
     sed -i "s:$currentwall:$WALL:g" /root/Choices/ROX-Filer/PuppyPin
     echo $WALL > $HOME/.config/wallpaper/bg_img
     rox --pinboard=/root/Choices/ROX-Filer/PuppyPin


As a note, the use of replaceit would probably make things easier than the use of sed, for the non specialist.

BFN.

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 
Display posts from previous:   Sort by:   
Page 1 of 7 [104 Posts]   Goto page: 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.1078s ][ Queries: 12 (0.0136s) ][ GZIP on ]