A Method To Assign Different Wallpapers To Specific Desktops

A home for all kinds of Puppy related projects
Post Reply
Message
Author
jimwg
Posts: 121
Joined: Mon 19 Aug 2013, 02:44

A Method To Assign Different Wallpapers To Specific Desktops

#1 Post by jimwg »

Greetings:

While using Mint I requested some Mint forum mavens whether they could improvise a way to assign wallpapers to particular desktops until Mint people actually install such in their OS, and the geniuses came up with this freebie to the linux community, courtesy of ToZ at Linux Mint Forums. It works really well! I am posting this in hopes that some enterprizing Puppy maven might somehow adapt it for Puppy:

Jim in NYC

# # #
install new:
1. save the code below to a file (e.g. $HOME/bin/wspm)
2. make the file executable
3. start it manually when you want to use it or add it to your startup applications for automatic use.



#!/bin/bash
# The Poor Man's Desktop/Workspace solution (version 2)
# Requires: wmctrl
# Make sure you edit the WORKSPACE configuration parameters to suit.

# make sure that only one instance of this script is running
lockfile=/tmp/.wspm.lockfile
if ( set -o noclobber; echo "locked" > "$lockfile") 2> /dev/null; then
trap 'rm -f "$lockfile"; exit $?' INT TERM EXIT
echo "wspmDEBUG: Locking succeeded" >&2

######### EDIT THESE VALUES #########################################################################
###
### WORKSPACE_WALL -> image file or backdrop list (slideshow images)
### WORKSPACE_STYLE -> 0=auto, 1=centered, 2=tiled, 3=stretched, 4=scaled, 5=zoomed
### WORKSPACE_CYCLETIMER -> for background slideshow, spceify how often in minutes to cycle image
###
### Note: You need one set of configuration parameters for each available workspace
###
### Workspace #1
WORKSPACE_WALL[1]="/home/toz/Pictures/avatars/avatar.png"
WORKSPACE_STYLE[1]=1
WORKSPACE_CYCLETIMER[1]=0
### Workspace #2
WORKSPACE_WALL[2]="/home/toz/Pictures/avatars/avatar.png"
WORKSPACE_STYLE[2]=2
WORKSPACE_CYCLETIMER[2]=0
### Workspace #3
WORKSPACE_WALL[3]="/home/toz/Pictures/avatars/avatar.png"
WORKSPACE_STYLE[3]=3
WORKSPACE_CYCLETIMER[3]=0
### Workspace #4
WORKSPACE_WALL[4]="/home/toz/.config/xfce4/desktop/backdrop.list"
WORKSPACE_STYLE[4]=0
WORKSPACE_CYCLETIMER[4]=1
#####################################################################################################

######### DO NOT EDIT BELOW #########################################################################
CURRENT_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s "${WORKSPACE_WALL[$CURRENT_WORKSPACE]}"
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-style -s "${WORKSPACE_STYLE[$CURRENT_WORKSPACE]}"
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/backdrop-cycle-timer -s "${WORKSPACE_CYCLETIMER[$CURRENT_WORKSPACE]}"

while true
do
sleep 1
NEW_WORKSPACE=$(($(wmctrl -d | grep \* | cut -d' ' -f1)+1))
if [ $CURRENT_WORKSPACE -ne $NEW_WORKSPACE ]; then
wmctrl -s $(($NEW_WORKSPACE)-1)
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s "${WORKSPACE_WALL[$NEW_WORKSPACE]}"
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-style -s "${WORKSPACE_STYLE[$NEW_WORKSPACE]}"
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/backdrop-cycle-timer -s "${WORKSPACE_CYCLETIMER[$NEW_WORKSPACE]}"
CURRENT_WORKSPACE=$NEW_WORKSPACE
fi
done

rm -f "$lockfile"
else
echo "wspmDEBUG: Lock failed - exit" >&2
exit 1
fi

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#2 Post by Karl Godt »

Package: xfconf
utilities for managing settings in Xfce
http://packages.debian.org/wheezy/xfconf

Dunno, some use xfce and others ratpoison .
I am too much basic it seems, living with maidservant jwm and Diva e17 .
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#3 Post by amigo »

wmctrl is nice because it does lots of cute things with lots of wm's

Could you please enclose your code in code tags?

jimwg
Posts: 121
Joined: Mon 19 Aug 2013, 02:44

#4 Post by jimwg »

Greetings!

I've been told that e17 roughly does this same trick, but only thing is you lose the kind of toolbar and easy desktop icon emplacement that you have in JWM, and though some say you can build el7's "shelf/ibar" toolbar to look and act the same as JWM's and XFCE's, I've no clue how. It makes things worst because it seems my MacPup 2.5.9 CD or flash install doesn't have fbpanel on it (just like no SeaMonkey) and Puppy mavens claim that you need fbpanel to configure items on the toolbar itself, like the clock format and making the whole toolbar auto-hide and such. But I'm open to be educated on methods how!

Jim in NYC

jimwg
Posts: 121
Joined: Mon 19 Aug 2013, 02:44

#5 Post by jimwg »

amigo wrote:wmctrl is nice because it does lots of cute things with lots of wm's

Could you please enclose your code in code tags?
I don't know how to do this, just cut and paste. I'm a tech newbie playing it by ear but I'd like to help. How do I do this code tag thing?

Jim in NYC

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#6 Post by musher0 »

musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#7 Post by musher0 »

Hello, all.

The following is a "seed" more than anything else...

Code: Select all

#!/bin/sh
# Script "seed" (an ideaware more than anything, at this point)
# /root/Choices/ROX-Filer/changePPin2.sh
# (c) musher0, 22 August 2013
#
# Goal: associate a backdrop with a desktop
# Dependencies: replaceit, rox, wmctrl
####

# Go to folder
cd /root/Choices/ROX-Filer/

# Create a 2nd backdrop
cp -f PuppyPin PuppyPin2 

# Define some alternative pictures
B1="/root/my-documents/mes-images/coyloups/coyote-in-snow-storm.jpg"
B2="/root/my-documents/mes-images/coyloups/coyote_jw1208-2.jpg"

# Choose one
BCKDRP="<backdrop style=\"Centred\">$B1</backdrop>"

# Change the old for the new
replaceit --input=/root/Choices/ROX-Filer/PuppyPin2 --wholeline backdrop "$BCKDRP"

# Activate the new backdrop
rox -p="/root/Choices/ROX-Filer/PuppyPin2"
sleep 0.1s
wmctrl -s 1 &

# Template line from PuppyPin
#  <backdrop style="Centred">/root/my-documents/mes-images/coyloups/coyote-in-snow-storm.jpg</backdrop>
W have to keep in mind that
* in ROX, after we have defined a new "Pinboard", we have to populate it with relevant icons to make it useful.

For example, assuming that we keep the general Puppy "pinboard" as
desktop 0, maybe we'd like to have a "writing" pinboard on desktop 1,
with a maximum of editing utilities (icons) on it.

And we would devote desktop 2 to games, for example. And so on;

* associating a pinboard with a desktop will make changing from one to the other slower. There's a trade-off, speed vs eye-candy vs practicality.

BFN

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#8 Post by L18L »

jimwg wrote:
amigo wrote:wmctrl is nice because it does lots of cute things with lots of wm's

Could you please enclose your code in code tags?
I don't know how to do this, just cut and paste. I'm a tech newbie playing it by ear but I'd like to help. How do I do this code tag thing?

Jim in NYC
Similiar to the way to have made amigo wrote:

Edit your post
Highlight your code
Click button Code

Easy :?:

jimwg
Posts: 121
Joined: Mon 19 Aug 2013, 02:44

#9 Post by jimwg »

musher0 wrote:Hello, all.

The following is a "seed" more than anything else...

Code: Select all

#!/bin/sh
# Script "seed" (an ideaware more than anything, at this point)
# /root/Choices/ROX-Filer/changePPin2.sh
# (c) musher0, 22 August 2013
#
# Goal: associate a backdrop with a desktop
# Dependencies: replaceit, rox, wmctrl
####

# Go to folder
cd /root/Choices/ROX-Filer/

# Create a 2nd backdrop
cp -f PuppyPin PuppyPin2 

# Define some alternative pictures
B1="/root/my-documents/mes-images/coyloups/coyote-in-snow-storm.jpg"
B2="/root/my-documents/mes-images/coyloups/coyote_jw1208-2.jpg"

# Choose one
BCKDRP="<backdrop style="Centred">$B1</backdrop>"

# Change the old for the new
replaceit --input=/root/Choices/ROX-Filer/PuppyPin2 --wholeline backdrop "$BCKDRP"

# Activate the new backdrop
rox -p="/root/Choices/ROX-Filer/PuppyPin2"
sleep 0.1s
wmctrl -s 1 &

# Template line from PuppyPin
#  <backdrop style="Centred">/root/my-documents/mes-images/coyloups/coyote-in-snow-storm.jpg</backdrop>
W have to keep in mind that
* in ROX, after we have defined a new "Pinboard", we have to populate it with relevant icons to make it useful.

For example, assuming that we keep the general Puppy "pinboard" as
desktop 0, maybe we'd like to have a "writing" pinboard on desktop 1,
with a maximum of editing utilities (icons) on it.

And we would devote desktop 2 to games, for example. And so on;

* associating a pinboard with a desktop will make changing from one to the other slower. There's a trade-off, speed vs eye-candy vs practicality.

BFN

musher0

I wish I could technically help you out but I'm not a techie and most of this is alien to me, but I'd be happy to beta test whatever you have! I'd really like to see such a thing work as well in Puppy as it does on XFCE!

Jim in NYC

jimwg
Posts: 121
Joined: Mon 19 Aug 2013, 02:44

#10 Post by jimwg »

L18L wrote:
jimwg wrote:
amigo wrote:wmctrl is nice because it does lots of cute things with lots of wm's

Could you please enclose your code in code tags?
I don't know how to do this, just cut and paste. I'm a tech newbie playing it by ear but I'd like to help. How do I do this code tag thing?

Jim in NYC
Similiar to the way to have made amigo wrote:

Edit your post
Highlight your code
Click button Code

Easy
I wish it was. I just don't see such a button or hotkey on that page. Sorry. I hope others can make out from what I was able to post okay!

Jim in NYC

jimwg
Posts: 121
Joined: Mon 19 Aug 2013, 02:44

#11 Post by jimwg »

An alternative for this that might be simplier is to create is a "switch wallpaper" icon button that allows a pre-set row of wallpapers to pop up in whatever desktop. Like a kind of macro shortcut from manually doing the Nathan Wallaper Settings each time. I'm just a newbie making suggestions that might not work!

Jiom in NYC

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#12 Post by musher0 »

jimwg wrote:An alternative for this that might be simplier is to create is a "switch wallpaper" icon button that allows a pre-set row of wallpapers to pop up in whatever desktop. Like a kind of macro shortcut from manually doing the Nathan Wallaper Settings each time. I'm just a newbie making suggestions that might not work!

Jiom in NYC
Hello, jimwg.

I was not asking for your help, I was just posting a "seed" in the hope
that some other developer would pick it up -- and/or come up with his/her
solution. I was just trying to stir up things.

Since we've had so many suggestions... I'll have to develop some more!

Actually, I had done something with "pills", not icons, really, on WheezyPup -- or was it Small Business Pup...

Give me a few days, I've got to finish a free-lancing contract, and I'll get back to you.

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#13 Post by musher0 »

Hello, again.

This went faster than expected.

Please find attached three scripts that will hopefully answer your need
for changing backdrops. Don't forget to make the scripts executable.

Please note that it is not possible in ROX to automatically change
backdrops AND desks, ROX was not designed that way. I'm using wmctrl
to artificially bring the user to the next desk after having changed the
ROX backdrop.

The dependency wmctrl is included in the pet package below.

This will require some involvement on your part: you will have to take my
three PuppyPin templates and populate them (or not!) according to your
needs, most importantly according to the programs you want shown on
a particular desk.

It's easy enough to do, you just drag a program from say, /usr/bin/
gmplayer and drop it where you like on the desk. But you have to do it.
Expect errors in icons if you use my examples "out of the box".

I have put the desk icons at the top right, but you may put them
wherever is convenient for you. The idea is to keep them together. In my
templates, the icon for the desk I'm on does not show, so I know at a
glance where I am.

The illustrations show some "pills" on the left. Those command some
ROX panels which I've located on the left. Please be patient: how to
create and change ROX panels will be the subject of the next chapter! 8)
For the time being, simply prefix with a "#" the "-l=(blabla)"
parameter at the end of the ROX line in the scripts.

Any questions, please ask. BFN.
Attachments
ChangePinBoards-0.1.pet
Double-click on this pet to install it. Then, copy the scripts from /root/Choices/ROX-Filer to each of the 3 pinboards you have created, and then &quot;clothe&quot; them with the icons provided in /root/my-documents/icones.
(26.78 KiB) Downloaded 489 times
ChangePinBoards-3.jpg
Same, but with an almost empty pinboard.
(57.13 KiB) Downloaded 577 times
ChangePinBoards-2.jpg
Desktop with icons for changing desktops (:-) at top right. You can also see that the scripts are basically the same.
(50.48 KiB) Downloaded 582 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

jimwg
Posts: 121
Joined: Mon 19 Aug 2013, 02:44

#14 Post by jimwg »

musher0 wrote:Hello, again.

This went faster than expected.

Please find attached three scripts that will hopefully answer your need
for changing backdrops. Don't forget to make the scripts executable.

Please note that it is not possible in ROX to automatically change
backdrops AND desks, ROX was not designed that way. I'm using wmctrl
to artificially bring the user to the next desk after having changed the
ROX backdrop.

The dependency wmctrl is included in the pet package below.

This will require some involvement on your part: you will have to take my
three PuppyPin templates and populate them (or not!) according to your
needs, most importantly according to the programs you want shown on
a particular desk.

It's easy enough to do, you just drag a program from say, /usr/bin/
gmplayer and drop it where you like on the desk. But you have to do it.
Expect errors in icons if you use my examples "out of the box".

I have put the desk icons at the top right, but you may put them
wherever is convenient for you. The idea is to keep them together. In my
templates, the icon for the desk I'm on does not show, so I know at a
glance where I am.

The illustrations show some "pills" on the left. Those command some
ROX panels which I've located on the left. Please be patient: how to
create and change ROX panels will be the subject of the next chapter! 8)
For the time being, simply prefix with a "#" the "-l=(blabla)"
parameter at the end of the ROX line in the scripts.

Any questions, please ask. BFN.
Looks beautiful!! I'll try to check this out so as I can! (as I posted before, my PreciseRetro 5.7 install isn't activating .PET files for some reason). The XFCE Mint people are trying to create an easy "Clonezilla-like" graphic front end to their verison to eliminate the command line and folder hunting stuff to attract more Mac and PC newbies to Mint, so when that shows up in code again I'll post it soon as possible.

Jim in NYC

jimwg
Posts: 121
Joined: Mon 19 Aug 2013, 02:44

#15 Post by jimwg »

Can't get it to work. Maybe a typo?

Jim in NYC

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#16 Post by musher0 »

Hi, jimwg.

What are you doing / not doing to get it to work? First you need to create 3 distinct
"PuppyPin" 's (as PuppyPin1, 2, and "vide", if I remember correctly. [I'm not on that
Puppy right now.]) So, it needs some "installation".

As I mentioned, you'll get errors if you try to use the scripts as they are. The reason is I
can't know what you want displayed / not displayed on your various desktops. The
script structure is sound, I'm sure, but the variables, i.e. what you want on your
desktops, are in your head ! :)

That said, I can "coach" you, if you wish. That may provide a nice example of the
process for other members, too.

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

jimwg
Posts: 121
Joined: Mon 19 Aug 2013, 02:44

#17 Post by jimwg »

Greetings!

Where can I find wmctrl in Porteus librarries? Thanks!

Jim in NYC

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#18 Post by musher0 »

Hello, jimwg.

I'm not familiar with Porteus depots, but you can have your pick here:
http://pkgs.org/search/?keyword=wmctrl

In the meantime, here's one for Puppy... :)

BTW, any luck with changing the ROX pinboards?

Best regards.

musher0
Attachments
wmctrl-1.07.pet
(19.3 KiB) Downloaded 157 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

jimwg
Posts: 121
Joined: Mon 19 Aug 2013, 02:44

#19 Post by jimwg »

musher0 wrote:Hello, jimwg.

I'm not familiar with Porteus depots, but you can have your pick here:
http://pkgs.org/search/?keyword=wmctrl

In the meantime, here's one for Puppy... :)

BTW, any luck with changing the ROX pinboards?

Best regards.

musher0
:D

Fantastic! After much fumbling and stumbling I finally have multiple customized desktop wallpapers! Thanks a trillion for the help! Now, if I can just be glutton in seeking a way to also separately clock down the minimum slide-show render period in XFCE from one minute down to at least ten seconds. Wallch does ten seconds in Mint but there's no working version in Puppy! :(

But super thanks for the help!

Jim in NYC

Post Reply