Page 1 of 1

JWM: Set different background image for each virtual desktop

Posted: Fri 27 Jun 2014, 05:45
by MochiMoppel
JWM has the ability to set individual backgrounds for each of its (max 10 ) virtual desktops.
To get the terms straight: Every Puppy I know by default boots into a "desktop" with several application- and drive icons and a background image. Technically this is not the desktop. It is a special ROX window, maximised, lowest layer and sticky. ROX calls it pinboard. This window is placed on JWM's desktop, which can have its own background, but users will never see JWM's desktop unless they remove the pinboard.

Let's start with the normal case:

Example 1: Set different ROX pinboard background for each virtual desktop
Example sets 4 virtual desktops in 1 row. Uses script /usr/local/apps/Wallpaper/set_bg and sets 4 images found in directory /usr/share/backgrounds/ of Slacko 5.6.

Step1: Edit /root/.jwm/jwmrc-personal and change

Code: Select all

<Desktops width="2" height="2"/>
to

Code: Select all

<Desktops width="4" height="1">
	<Desktop><Background type="command">/usr/local/apps/Wallpaper/set_bg /usr/share/backgrounds/default.jpg</Background></Desktop>
	<Desktop><Background type="command">/usr/local/apps/Wallpaper/set_bg /usr/share/backgrounds/puppylinux.jpg</Background></Desktop>
	<Desktop><Background type="command">/usr/local/apps/Wallpaper/set_bg /usr/share/backgrounds/bike-outback.jpg</Background></Desktop>
	<Desktop><Background type="command">/usr/local/apps/Wallpaper/set_bg /usr/share/backgrounds/world-fiveworld.png</Background></Desktop>
</Desktops>
Step 2: Restart JWM

Example 2: Set different JWM background for each virtual desktop
"Hardcore" users who remove the pinboard know how to do it and how to reset it, so I will not explain here. They have more options to set the background and can also use solid or gradient colors:

Code: Select all

<Desktops width="4" height="1">
	<Desktop><Background type="solid">#870025</Background></Desktop>
	<Desktop><Background type="gradient">#000000:#0000DD</Background></Desktop>
	<Desktop><Background type="tile">/usr/share/icons/sys-info.png</Background></Desktop>
	<Desktop><Background type="image">/usr/share/backgrounds/default.jpg</Background></Desktop>
</Desktops>
<Background type="command"> could also be used. It can run any script(s) or command(s) when a user switches to the desktop.

Re: JWM: Set different background image for each virtual desktop

Posted: Fri 27 Jun 2014, 07:19
by greengeek
MochiMoppel wrote:<Background type="command"> could also be used. It can run any script(s) or command(s) when a user switches to the desktop
That sounds like a handy tool. Thanks for the tutorial.

Posted: Fri 27 Jun 2014, 17:26
by musher0
Yeah, thanks, MochiMoppel.

I didn't know jwm could do that. (Blame its complicated docs...)

BFN.

musher0

Posted: Sun 29 Jun 2014, 16:16
by gcmartin
I have a need to set a different background on the last virtual desktop. So from your 4 desktop example1, how would I leave all the same and ONLY change the background in the very last desktop?

Thanks in advance for any guidance

Posted: Mon 30 Jun 2014, 00:37
by MochiMoppel
gcmartin wrote:how would I leave all the same and ONLY change the background in the very last desktop?
This should work:

Code: Select all

<Desktops width="4" height="1">
  <Background type="command">/usr/local/apps/Wallpaper/set_bg /usr/share/backgrounds/bike-outback.jpg</Background>
    <Desktop></Desktop> 
    <Desktop></Desktop> 
    <Desktop></Desktop> 
    <Desktop><Background type="command">/usr/local/apps/Wallpaper/set_bg /usr/share/backgrounds/world-fiveworld.png</Background></Desktop> 
</Desktops>
The 2nd line sets the default background for all desktops. You can set a different background for any individual desktop, but you have to tag every desktop up to the changed one so that JWM can count and know which one to change. If you had 10 instead of only 4 desktops, above example would still change only the 4th and apply the default image to desktops 5~10.

Re: JWM: Set different background image for each virtual desktop

Posted: Mon 30 Jun 2014, 14:41
by Bushbuck
MochiMoppel wrote:JWM has the ability to set individual backgrounds for each of its (max 10 ) virtual desktops...
Thanks for the instructions, MochiMoppel! :D
I've always wanted to do this, but didn't know how, or if it was possible.

Posted: Mon 30 Jun 2014, 21:28
by gcmartin
Thanks @MochiMoppel, that makes perfect.

Curious
Wonder if this can be applied to FD6xx and PUPs which use Openbox instead of JWM?

thanks MochiMoppel

Posted: Wed 30 Jul 2014, 16:20
by mister_electronico
thanks MochiMoppel works perfect in slacko 5.7...

very good post.