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 25 May 2016, 18:50
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Different wallpaper and icons on each desktop
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [24 Posts]   Goto page: 1, 2 Next
Author Message
rufwoof


Joined: 24 Feb 2014
Posts: 1309
Location: UK

PostPosted: Sun 22 Nov 2015, 05:50    Post subject:  Different wallpaper and icons on each desktop  

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.php?p=871518#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:
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



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



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



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



Desktop 5 Closure - Shutdown preparation and activation



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, 19:28; edited 1 time in total
Back to top
View user's profile Send private message 
gcmartin


Joined: 14 Oct 2005
Posts: 6319
Location: Earth

PostPosted: Sun 22 Nov 2015, 12:53    Post subject: Now, we can have Multiple Desktops ability in a running PUP  

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

Thanks

_________________
Get ACTIVE Create Circles; Do those good things which benefit people's needs!
We are all related ... Its time to show that we know this!
3 Different Puppy Search Engines or use DogPile
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 1309
Location: UK

PostPosted: Sun 22 Nov 2015, 21:01    Post subject:  

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:
<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>
Back to top
View user's profile Send private message 
ebisu

Joined: 25 Sep 2013
Posts: 160

PostPosted: Sun 22 Nov 2015, 22:00    Post subject:  

Sooner or later this will make a mess of your drive icons Laughing
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 1309
Location: UK

PostPosted: Mon 23 Nov 2015, 15:22    Post subject:  

ebisu wrote:
Sooner or later this will make a mess of your drive icons Laughing

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

Joined: 04 May 2012
Posts: 628

PostPosted: Mon 23 Nov 2015, 16:57    Post subject:  

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.
_________________
Fatdog64-702|+Packages|Findnrun|+forum|OpenMediaVault
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 1309
Location: UK

PostPosted: Mon 23 Nov 2015, 19:34    Post subject:  

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:
<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:
#!/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.
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 1309
Location: UK

PostPosted: Sat 28 Nov 2015, 06:35    Post subject:  

This is the most recent version of the script code that I'm using
Code:
#!/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/0B4MbXu8cvE_Wdmx6NjZwR0NRYUU/view?usp=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.php?p=874548#874548
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 1309
Location: UK

PostPosted: Sat 28 Nov 2015, 07:17    Post subject:  

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


Joined: 24 Feb 2014
Posts: 1309
Location: UK

PostPosted: Sun 29 Nov 2015, 09:10    Post subject:  

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.
aug.jpg
 Description   
 Filesize   33.43 KB
 Viewed   366 Time(s)

aug.jpg

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


Joined: 24 Feb 2014
Posts: 1309
Location: UK

PostPosted: Sun 13 Dec 2015, 16:55    Post subject:  

rufwoof wrote:
...and this video is a test of that https://drive.google.com/file/d/0B4MbXu8cvE_Wdmx6NjZwR0NRYUU/view?usp=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 Sad

The single frame video preview image that google selected was purely by chance the big puppy face icon Smile Rather than losing that I've decided to just leave the video as-is.
s.jpg
 Description   
 Filesize   39.94 KB
 Viewed   296 Time(s)

s.jpg

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

Joined: 04 May 2012
Posts: 628

PostPosted: Mon 14 Dec 2015, 05:02    Post subject:  

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?

_________________
Fatdog64-702|+Packages|Findnrun|+forum|OpenMediaVault
Back to top
View user's profile Send private message 
rufwoof


Joined: 24 Feb 2014
Posts: 1309
Location: UK

PostPosted: Mon 14 Dec 2015, 07:17    Post subject:  

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


Joined: 24 Feb 2014
Posts: 1309
Location: UK

PostPosted: Mon 14 Dec 2015, 07:45    Post subject:  

Previously I've toyed around with having different resolutions on different desktops http://www.murga-linux.com/puppy/viewtopic.php?p=818951#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.
Back to top
View user's profile Send private message 
LazY Puppy


Joined: 21 Nov 2014
Posts: 1063
Location: Germany

PostPosted: Mon 14 Dec 2015, 08:30    Post subject:  

rufwoof wrote:
ebisu wrote:
Sooner or later this will make a mess of your drive icons Laughing

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

T.O.P.L.E.S.S. - the Multi-Language Puppy Linux Wrapper.
Just use one single frugal install of a Puppy Linux (32 & 64bit) to be personalised in many different ways.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [24 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
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.0926s ][ Queries: 12 (0.0167s) ][ GZIP on ]