Different wallpaper and icons on each desktop

Window managers, icon programs, widgets, etc.
Message
Author
User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

Different wallpaper and icons on each desktop

#1 Post by rufwoof »

I've implemented 5 different desktops each with their own choice of wallpaper (background), icons and icon arrangements in this pup http://murga-linux.com/puppy/viewtopic. ... 518#871518

Once implemented you can for instance go to desktop 3, right click and use wall paper setter to allocate a wallpaper to that desktop, add/remove/rearrange the icons on that desktop, and then switch to another desktop and do similar there ... and end up with a varied range of desktop backgrounds, icons and icon arrangements across the 5 desktops.

Here are the notes of how I implemented that

Code: Select all

Used jwm config to define 1 row 5 column desktops
and jwm restarted

/usr/local/jwmconfig2/

files changed to remove the desktop background
and number of virtual desktops options as they
would conflict with our hard-coding

~/Choices/ROX-Filer PuppyPin initially copied 
repeatedly to PuppyPin1 PuppyPin2 ... PuppyPin5
so each of the 5 desktops have their own associated
PuppyPin

~/.jwm/jwm-personal

Commented out the former desktops defition

<!--

<Desktops width="5" height="1"/>

-->

and replaced with

<Desktops width="5" height="1">
   <Desktop><Background type="command">/usr/sbin/desktoppin 1</Background></Desktop>
   <Desktop><Background type="command">/usr/sbin/desktoppin 2</Background></Desktop>
   <Desktop><Background type="command">/usr/sbin/desktoppin 3</Background></Desktop>
   <Desktop><Background type="command">/usr/sbin/desktoppin 4</Background></Desktop>
   <Desktop><Background type="command">/usr/sbin/desktoppin 5</Background></Desktop>
</Desktops>

Which fires off /usr/sbin/desktoppin each time
a desktop is switched

/usr/sbin/desktoppin created and made executable containing

#!/bin/bash
# Rufwoof Nov 2015
# Different icon arrangements on different desktops
# Very limited at present i.e. doesn't support
# changes of number of desktops etc.
#
if [ "$1" = "" ]; then
  exit
fi
cd ~/Choices/ROX-Filer
previous=`cat ~/.currentdesktop`
echo $1 > ~/.currentdesktop
# Sanity check
sane=`cat PuppyPin | grep PuppyPin$previous`
if [ "$sane" = "" ]; then 
  # Hmm!!! Doesn't seem to match so don't bother 'preserving'
   echo
else
   cp -f PuppyPin PuppyPin$previous # Save any changes on old desktop
fi
cp PuppyPin$1 PuppyPin           # Swap in the new desktops background/icons
rox -p $HOME/Choices/ROX-Filer/PuppyPin  



Create a image using mtpaint of just 1 pixel and saved
that to /usr/share/icons as a file called dot.png

For each of the PuppyPin1, PuppyPin2 ... PuppyPin5 files 
in ~/Choices/ROX-Filer the files icon was set to be that dot.png

Opening up each of the 5 desktops I dragged the respective
~/Choices/ROX-Filer/PuppyPin1....etc to the desktop, such
that desktop 1 had a ~/Choices/ROX-Filer/PuppyPin1 icon, desktop 
2 had a ~/Choices/ROX-Filer/PuppyPin2 icon ...etc As the icon is 
just a 1 pixel image it was pretty much hidden, only the icons
comment (text) was visible. By right clicking and Editing the
deskop icon and deleting the 'comment below icon' text, thereafter
the icon more of less became totally invisible.

Having a PuppyPin1 'invisible' icon on desktop1, PuppyPin2 icon on
desktop2 .... etc means that each of the PuppyPin files can be
identified by a grep. I couldn't figure out a way to add comments
to PuppyPin so having a 'invisible' entry in each was the next best choice.


With all that set (don't think I've missed anything), you have a
setup that is fixed at 5 desktops (as switching to other arrangements
could lead to problems) and where each desktop has its own PuppyPin.
As the desktop background, icons and icon locations are stored in
PuppyPin (excepting the drive and other fixed icons such as Trash etc)
then each desktop can have its own background (wallpaper) and 
icons/icon position arrangements.
My first cut version was pretty simple - just straight copies, however by far the biggest problem with that was if a window were dragged across multiple desktops then the original code screwed up as it ran multiple runs in effect at the same time (when the mouse was finally released to drop the window on a desktop) and race conditions resulted in incorrect behaviour (wrong PuppyPin being preserved or copied in). The solution was to add a sanity check - which resulted in the use of 'hidden' desktop icons being used.

I've seen examples for different wallpapers on different desktops, but not one for different icons/icon arrangements so I decided to post this guide of how I did it here.

I've used a Cosmos theme for my 5 desktops, theme'ing each desktop with different desktop icons and backgrounds in reflection of a typical session.

Desktop 1 - Dark Years - initial boot and creation

Image

Desktop 2 - Nebula - downloading and/or installing other SFS's

Image

Desktop 3 - Fruitful - main work desktop for use when browsing, editing ...etc.

Image

Desktop 4 Twilight - Used as a store of work files in readiness for saving to the Cloud or USB or wherever prior to shutdown

Image

Desktop 5 Closure - Shutdown preparation and activation

Image

The above images are early snapshots and with the exception of the first are spartan of icons. More or less just a example of what sort of arrangements can be created.

EDIT : When on the desktop the scroll wheel scrolls through the desktops. More often that's a annoyance and in the case of the above it can screw up the desktops. Whilst there's no disable desktop scrollwheel action there is a trick/workaround, simply add

<RootMenu onroot="4"/>
<RootMenu onroot="5"/>

to /root/.jwm/jwmrc-personal
Last edited by rufwoof on Sun 22 Nov 2015, 23:28, edited 1 time in total.

gcmartin

Now, we can have Multiple Desktops ability in a running PUP

#2 Post by gcmartin »

You and @StemSee are the preeminent distro authors showing the development community this benefit. ... and user use of this.

Thanks

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#3 Post by rufwoof »

I made hard work of it all. A simpler approach is to just copy PuppyPin to PuppyPin1, PuppyPin2 ...etc and then point rox -p to the respective copy directly i.e. in jwmrc-personal

Code: Select all

<Desktops width="5" height="1">
   <Desktop><Background type="command">rox -p /root/Choices/ROX-Filer/PuppyPin1</Background></Desktop>
   <Desktop><Background type="command">rox -p /root/Choices/ROX-Filer/PuppyPin2</Background></Desktop>
   <Desktop><Background type="command">rox -p /root/Choices/ROX-Filer/PuppyPin3</Background></Desktop>
   <Desktop><Background type="command">rox -p /root/Choices/ROX-Filer/PuppyPin4</Background></Desktop>
   <Desktop><Background type="command">rox -p /root/Choices/ROX-Filer/PuppyPin5</Background></Desktop>
</Desktops>

ebisu
Posts: 176
Joined: Wed 25 Sep 2013, 05:06

#4 Post by ebisu »

Sooner or later this will make a mess of your drive icons :lol:

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#5 Post by rufwoof »

ebisu wrote:Sooner or later this will make a mess of your drive icons :lol:
Good point. I'm revising the code to take that into account. Inheriting the drive icons from the immediately prior desktop. Working OK so far except when a USB is removed its leaving the drive icon on the desktop, but vanishes if desktops are switched.

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#6 Post by step »

Just as a thought, I think the proper way to change rox pinboards is to script rox via its SOAP interface. Then the way to add/remove drive icons is to call puppy's drive-icon refresh script - sorry, it varies with each puppy so I don't know which one is yours, but there definitely is one.
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#7 Post by rufwoof »

Thanks. Quite a bit above my head to use RPC's. My approach is to simply egrep -v out the drives in the dektop (PuppyPin) being swapped in and grep out the drives in the current active PuppyPin and insert those into the PuppyPin being swapped in, before loading/activating.

Seems to work OK, load a USB on one desktop and up it pops, swap desktops and its on the new one, swap to another desktop and unload it and it disappears.

I did have to go through several other system scripts to change references to PuppyPin to PuppyPin$PIN i.e. where $PIN is set to the current active desktop.

My jwmrc-personal relevant desktop section now looks like

Code: Select all

<Desktops width="5" height="1">
   <Desktop><Background type="command">/root/Choices/ROX-Filer/Script 1</Background></Desktop>
   <Desktop><Background type="command">/root/Choices/ROX-Filer/Script 2</Background></Desktop>
   <Desktop><Background type="command">/root/Choices/ROX-Filer/Script 3</Background></Desktop>
   <Desktop><Background type="command">/root/Choices/ROX-Filer/Script 4</Background></Desktop>
   <Desktop><Background type="command">/root/Choices/ROX-Filer/Script 5</Background></Desktop>
</Desktops>
and the Script script contents are

Code: Select all

#!/bin/sh
cd /root/Choices/ROX-Filer
prior=`cat current`
echo $1 >current
# strip out any stored drive icons and strip of </pinboard>
cat PuppyPin$1 | egrep -v ".pup_event" | sed s/\<\\/pinboard\>// >tmp$$
# Add in drives from immediately prior PuppyPin
ls -b /root/.pup_event >tmpL$$
cat PuppyPin$prior | grep "/root/.pup_event/drive" >>tmpM$$
cat tmpM$$ | grep -f tmpL$$ >>tmp$$
echo "</pinboard>" >>tmp$$
rm tmpL$$
rm tmpM$$
mv -f tmp$$ PuppyPin$1
rox -p /root/Choices/ROX-Filer/PuppyPin$1
i.e I store the current desktop number in a file called 'current'. Messy and likely not the best/fastest as my scripting skills are pretty low (have to hunt around for example of how to do things and copy/adapt the examples I find).

Looking at that I've just noticed I need to expand the egrep -v search string to similar/same as the more expanded grep statement later in the code as there is/might be some other entries with "pup_event" in their PuppyPin entry other than for drives.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#8 Post by rufwoof »

This is the most recent version of the script code that I'm using

Code: Select all

#!/bin/sh

# ignore multi reiterations (spinning scrollwheel)
multi=`ps | grep "ROX-Filer -p" | wc -l`
if [ $multi -gt 3 ]; then
  exit
fi
cd /root/Choices/ROX-Filer # cd to where ROX Pinboards are stored
prior=`cat current`        # current desktop is stored in /root/Choices/ROX-Filer/current
echo $1 >current           # Set 'current' to the new desktop number

# strip out any stored drive icons, </pinboard> and blank lines
cat PuppyPin$1 | egrep -v "pup_event/drive" | egrep -v "</pinboard>" | sed '/^$/d' >tmp$$

# Add in drives from immediately prior PuppyPin
# We use /root/.pup_event to match drives as being valid
ls -b /root/.pup_event >tmpL$$
# Grab existing drives from old desktop, using pup_event contents as a grep filter (sort unique to prevent multiple entries)
cat PuppyPin$prior | grep "/root/.pup_event/drive" | grep -f tmpL$$ | sort -u >>tmp$$
echo "</pinboard>" >>tmp$$ # Add on closing </pinboard> to XML file

mv -f tmp$$ PuppyPin$1;
rm tmpL$$ tmpM$$           # housekeeping
rox -p /root/Choices/ROX-Filer/PuppyPin$1 # Set rox to use the new desktop
and this video is a test of that https://drive.google.com/file/d/0B4MbXu ... sp=sharing

There is some transition delay, noticeable but acceptable. If drive icons were omited or preserved elsewhere then the simpler earlier choice of swap puppy pin (change of sym link) would be the faster/smoother.

See this post for guidance of how to 'install' it
http://murga-linux.com/puppy/viewtopic. ... 548#874548

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#9 Post by rufwoof »

A couple of nice other touches is to change /etc/xdg/templates/_root_.jwmrc onroot=3 (which is right mouse click) to onroot=1 (which is left mouse click). And in ~/jwmrc-tray also change onroot=3 to onroot=1 so that the menu button (bottom left) correctly pops up when clicked. And in ~/.jwm/jwm-personal add

<RootMenu onroot="4"/>
<RootMenu onroot="5"/>

(which are middle button/scrollwheel - setting them to do nothing when the mouse is over a empty desktop region.

The above will stop 'accidental' switching of desktops with the scrollwheel when over tne desktop (but you can still scroll the desktops when the mouse is over a desktop tray), activate the menu button (bottom left) whenever clicked, and bring up the menu when the desktop is left-mouse clicked (but the right mouse click of desktop will do nothing).

That's more in keeping with touchpad type devices IMO. Touch/hold/drag the desktop to activate the menu; Avoid accidental scrolling onto another desktop when using a mouse; Whilst leaving right mouse click free (empty) for when the pup has sometimes lost-its-way (doesn't know whether to open ROX or show the menu) i.e. a few desktop right-mouse clicks usually repoints the pup back on track again.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#10 Post by rufwoof »

Creating 12 different puppy pins and setting up 12 desktops, each with different desktop wallpaper and different icons opens up the potential of using the desktop as a Calendar.

Drag/drop files onto the desktop, coinciding with events/days and you can easily jump to a specific month (desktop) and access files/data/events due or done on those days. Or move them (icons) around easily as re-arranged/changed.

The attached is just a quick-n-easy example (could have been sized better to take into account the tray etc). In practice you might use a wallpaper image more reflective of the season/month.

After trying that out for a bit, another column for more 'usual' desktops alongside (i.e. sized to 5 columns x 3 rows perhaps, with the first column (3 desktops) being a more usual desktop style would seem more apporopriate IMO. i.e. the more usual clutter of icons on those desktops.
Attachments
aug.jpg
(33.43 KiB) Downloaded 928 times

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#11 Post by rufwoof »

rufwoof wrote:...and this video is a test of that https://drive.google.com/file/d/0B4MbXu ... sp=sharing
Edited the video to add some background music (royalty free) and only after it was re-uploaded did I notice the spelling mistake. Tried correcting - but made a bit of a hash of it :(

The single frame video preview image that google selected was purely by chance the big puppy face icon :) Rather than losing that I've decided to just leave the video as-is.
Attachments
s.jpg
(39.94 KiB) Downloaded 728 times

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#12 Post by step »

I watched the video, it's nice to see how desktop backgrounds change automatically as you drag the window across the screen!
Is the script in your Sat 28 Nov 2015, 06:35 posting still the latest version? I might re-use it to attempt the same functionality for openbox (no promise), if you don't mind. If the script all I need to start?
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#13 Post by rufwoof »

The current best choice so far for me seems to be to

have a script in /root/Startup that contains

#!/bin/bash
rm /root/Choices/ROX-Filer/current


A script called Script in /root/Choices/ROX-Filer that contains

#!/bin/bash
# strip out any stored drive icons, </pinboard> and blank lines
if [ "$1" = "1" ]; then
cat PuppyPin | egrep -v "pup_event/drive" | egrep -v "</pinboard>" | sed '/^$/d' >tmp$$
else
cat PuppyPin$1 | egrep -v "pup_event/drive" | egrep -v "</pinboard>" | sed '/^$/d' >tmp$$
fi
# Add in drives from immediately prior PuppyPin
# We use /root/.pup_event to match drives as being valid
cat PuppyPin$prior | grep "/root/.pup_event/drive" | grep "`ls -1b /root/.pup_event`" >>tmp$$
echo "</pinboard>" >>tmp$$ # Add on closing </pinboard> to XML file

if [ "$1" = "1" ]; then
mv -f tmp$$ PuppyPin
else
mv -f tmp$$ PuppyPin$1;
fi
rox -p /root/Choices/ROX-Filer/PuppyPin$1 # Set rox to use the new desktop


And then make 9 copies of /root/Choices/ROX-Filer/PuppyPin to PuppyPin2, PuppyPin2, PuppyPin10 and create a symlinked PuppyPin1 that links to PuppyPin

You also have to change /root/.jwm/jwmrc-personal to have (the width and height options may differ according to howmany desktops you have set up)

<!-- Number of virtual desktops -->
<Desktops width="3" height="1"

<Desktop><Background type="command">/root/Choices/ROX-Filer/Script 1</Background></Desktop>
<Desktop><Background type="command">/root/Choices/ROX-Filer/Script 2</Background></Desktop>
<Desktop><Background type="command">/root/Choices/ROX-Filer/Script 3</Background></Desktop>
<Desktop><Background type="command">/root/Choices/ROX-Filer/Script 4</Background></Desktop>
<Desktop><Background type="command">/root/Choices/ROX-Filer/Script 5</Background></Desktop>
<Desktop><Background type="command">/root/Choices/ROX-Filer/Script 6</Background></Desktop>
<Desktop><Background type="command">/root/Choices/ROX-Filer/Script 7</Background></Desktop>
<Desktop><Background type="command">/root/Choices/ROX-Filer/Script 8</Background></Desktop>
<Desktop><Background type="command">/root/Choices/ROX-Filer/Script 9</Background></Desktop>
<Desktop><Background type="command">/root/Choices/ROX-Filer/Script 10</Background></Desktop>

</Desktops>


That initialises and remains relatively stable for me. Bearing in mind I don't use a savefile/folder for me that's initialised that way each and every time I reboot. Not sure how it might work out if changes were preserved (savefile).

The drive icons are the problem, hot plugging in/removing doesn't always clear the drive icon from the current desktop for me, but vanishes when the desktop is changed.

Having 10 initial copies of PuppyPin caters for changes to the number of desktops being made i.e. if the user switches from perhaps 3 desktops to 5 desktops using jwm configuration.

KEEP BACKUP COPIES of the files changed and make a backup of the puppy before using. It works for me but your mileage may vary. I also use jwm and rox, not sure how it might fair under openbox.

It could be simpler if no drive icons were being displayed on the desktop. Then it would just be a case of jwmrc-personal simply invoking the rox -p <puppypin> directly itself. I'm thinking of going down that road myself, expense of loss of desktop drive icons for the benefit of multiple desktops and then figure out a alternative for display of the drive icons (panel or something like that).

I'm converging to preferring three desktops, first for startup type icons (remote connect, VNC and Samba Servers, configuration, connect ...etc. The second for general use, browser, word processor etc, and the last for shutdown/reboot/restart windows manager etc.

PS another factor : some pup's are set up so that you can drag a window from one desktop to another, other pup's 'bump' into the screen edge when a window is dragged 'off screen'. I prefer the former choice, but that's not a user configurable option as far as I can tell, seems to be a compiled (developer) option. For the latter you're tied to using right click/drag of windows in the smaller tray desktops to move a window from one desktop to another, or using the far left icon in the windows titlebar to 'Send To' a window to another desktop number.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#14 Post by rufwoof »

Previously I've toyed around with having different resolutions on different desktops http://www.murga-linux.com/puppy/viewto ... 951#818951

With different devices each having RDP server and client (RDP client comes as bulk standard in Windows for instance and as a app for smartphones - RDP is a remote desktop control (like vnc/teamview etc.) ... and different icons on each puppy desktop, you could set up a set where any one device could remote control all other devices.

Desktop 1 a puppy desktop, desktop2 having rdp client icon to you windows rdp server, desktop 3 rdp client to your smartphone ... with the resolution perhaps changing to the appropriate choice and from that PC you can run puppy, windows and android apps. Or rdp into that PC from your smartphone and you can run puppy and windows apps alongside the phones android apps.

With ever increasing data transfer speeds, London is currently transitioning to 300Mb wireless (phone) speeds for instance, and rdp (screen content transfer) is/will become more responsive/quicker. With PC's on a stick (USB) and wireless, the number of PC's will expand, perhaps one with a web cam in the fridge so you can remotely see if you have enough beers already, or need to buy some more whilst your out ...etc.

User avatar
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

#15 Post by LazY Puppy »

rufwoof wrote:
ebisu wrote:Sooner or later this will make a mess of your drive icons :lol:
Good point. I'm revising the code to take that into account. Inheriting the drive icons from the immediately prior desktop. Working OK so far except when a USB is removed its leaving the drive icon on the desktop, but vanishes if desktops are switched.
Use the Rox XML Commands to add/remove Icons from the PuppyPin!

Examples:

<PinboardAdd>
<Path>/usr/local/RoxApp_Builder/Application_Starter/Mischpult</Path>
<X>554</X>
<Y>128</Y>
<Label>Mischpult</Label>
<Args></Args>
<Locked>true</Locked>
<Shortcut></Shortcut>
</PinboardAdd>

<PinboardRemove>
<Path>/root/my-roxapps/Advanced-SFS-PLUS-Suite</Path>
<Label>SFS P.L.U.S. Suite</Label>
</PinboardRemove>

It will never ever touch the Drive Icons.

In the German Forum you'll find the Original VarioMen(ü) made by SFR and der-schutzhund, that is using the PinboardAdd/PinboardRemove technique. No need to create/have multiple PuppyPin Files and to copy them all the way, to change Desktops/Icon Setup..
RSH

"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#16 Post by rufwoof »

LazY Puppy wrote:
rufwoof wrote:
ebisu wrote:Sooner or later this will make a mess of your drive icons :lol:
Good point. I'm revising the code to take that into account. Inheriting the drive icons from the immediately prior desktop. Working OK so far except when a USB is removed its leaving the drive icon on the desktop, but vanishes if desktops are switched.
Use the Rox XML Commands to add/remove Icons from the PuppyPin!

Examples:

<PinboardAdd>
<Path>/usr/local/RoxApp_Builder/Application_Starter/Mischpult</Path>
<X>554</X>
<Y>128</Y>
<Label>Mischpult</Label>
<Args></Args>
<Locked>true</Locked>
<Shortcut></Shortcut>
</PinboardAdd>

<PinboardRemove>
<Path>/root/my-roxapps/Advanced-SFS-PLUS-Suite</Path>
<Label>SFS P.L.U.S. Suite</Label>
</PinboardRemove>

It will never ever touch the Drive Icons.

In the German Forum you'll find the Original VarioMen(ü) made by SFR and der-schutzhund, that is using the PinboardAdd/PinboardRemove technique. No need to create/have multiple PuppyPin Files and to copy them all the way, to change Desktops/Icon Setup..
Thanks LazyPup

Meine Kenntnisse der deutschen Sprache ist nicht gut.

This is another variant I've just been trying. Storing just the icons and wallpaper from each desktop in P1, P2 ...etc files and loading those in along with the drives as a desktop is switched to (storing the prior (current) desktops icons/wallpaper before switching).

cd /root/Choices/ROX-Filer # cd to where ROX Pinboards are stored
prior=`cat current` # current desktop is stored in /root/Choices/ROX-Filer/current
echo $1 >current # Set 'current' to the new desktop number


# Preserve current desktops icons/wallpaper
# strip out any stored drive icons, </pinboard> and blank lines
cat PuppyPin | grep "pup_event/drive" >tmp$$drives
cat PuppyPin | egrep -v "pup_event/drive" | egrep -v "<?xml" | egrep -v "<pinboard>" | egrep -v "</pinboard>" | sed '/^$/d' >P$prior
cat PuppyPin | egrep -v "<backdrop" | egrep -v "<icon" | egrep -v "</pinboard>" | sed '/^$/d' >tmp$$
cat P$1 >>tmp$$
cat tmp$$drives >>tmp$$
echo "</pinboard>" >>tmp$$ # Add on closing </pinboard> to XML file
mv -f tmp$$ PuppyPin
rm tmp$$drives
rox -p /root/Choices/ROX-Filer/PuppyPin # Set rox to use the new desktop


So far that seems to be a lot better at handling drives being hot plugged/unplugged.

Using SOAP (Rox's interpretor) is I guess a cleaner way of doing that and I'll have to did deeper into what you highlighted.

Thanks again.

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#17 Post by rufwoof »

Returning to the choice in http://murga-linux.com/puppy/viewtopic. ... 922#873922 i.e. direct calling of a PuppyPin for each desktop, and removing desktop icons, replacing them with a wbar with desktop icons is a relatively simple and quite nice choice IMO.

I have a vertical animated wbar above the MENU button showing all of the drive icons, that animates (jumps out a little) as the mouse is moved over the drives. Hot plugging in/our of USB's also appears/disappears in/from the wbar ok when using a modified version of http://murga-linux.com/puppy/viewtopic. ... 911#820911

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#18 Post by step »

rufwoof, thanks for the updated explanation. Some of the jwm settings that you described might not have counterparts in the openbox configuration files. I will need to take a look, but I don't have enough time right now.

RHS's advice reiterates what I mentioned earlier in this thread; use XML / a.k.a. RPC a.k.a. SOAP to add/remove rox icons, and even to change the background picture. That way you won't have to worry about multiple PuppyPins. In fact, if you can manage to change the background of a single PuppyPin you won't have to deal with re-creating desktop icons (unless you want to have different icons on different desktops).

Changing the desktop background is just one SOAP function. Check if your Puppy has a file named /usr/local/apps/Wallpaper/set_bg - that file includes shell code to change the background picture with SOAP.

This is the code I use in my modified version of set_bg for Fatdog64, where $NEWIMAGE is the absolute path to the new background image file:

Code: Select all

# ... stuff before ...
if which rox >&- 2>&-; then
#tell rox to use new bg image, note this will also write to ${HOME}/Choices/ROX-Filer/PuppyPin
# Careful! If ROX-Filer doesn't grok the $NEWIMAGE file type it will actually
# delete $NEWIMAGE (with a dialog window that says 'removing the backdrop').
 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><![CDATA[${NEWIMAGE}]]></Filename>
   <Style>${MODE}</Style>
  </SetBackdrop>
 </env:Body>
</env:Envelope>

EOF
 echo "${NEWIMAGE}" > ${HOME}/.config/wallpaper/bg_img
else
 true
 #need to use xsetroot or something.
fi
# End of script
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#19 Post by rufwoof »

Thanks Step

Having 10 PuppyPin's directly called is pretty quick to change desktop, and is in effect a database of what icons on what desktops that would have to be maintained anyway (for SOAP commands to add/remove as you 'switched' desktops).

With no drive icons included its also a easy option.

Adding drive icons in a wbar is quite a nice effect as they're animated. In d3 of the attached images you can't really see it but the topmost drive is being hovered over and has balloned out a bit (configurable, but I have it set to relatively little motion).

And you still have the mounted (or not) flag in the top right corner of the drive icon. The only inconvienience is that when clicked you have a Open (to view) or Unmount dialog to additionally click.

Not sure how well a wbar might work with those that have 20 or 30+ drives as I've seen in some desktop snapshots hereabouts though. So not a generic option.

Working well so far. Only 'bug' is that a window over the wbar can leave a residue when moved. Right clicking the wbar resets/clears that. Another bug is that if you scrollwheel on the desktop rapidly it does flicker for a few seconds whilst the processing catches up with all of those desktop switches. But unlike my ealier version does ultimately land on the right desktop (my prior version sometimes fell short and needed another (slow) desktop switch to correct itself).
Attachments
d1.jpg
(37.21 KiB) Downloaded 323 times
d2.jpg
(37.69 KiB) Downloaded 321 times
d3.jpg
(32.92 KiB) Downloaded 327 times

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#20 Post by rufwoof »

This is with the drives animation effect set to a more pronounced level as you hover over them.
Attachments
s2.jpg
(39.19 KiB) Downloaded 319 times
s.jpg
(39.19 KiB) Downloaded 333 times

Post Reply