Different background for each workspace?

Archived topics about LMDE 1 and LMDE 2
garolou

Re: Different background for each workspace?

Post by garolou »

Yes there is a small delay for the image to load after the workspace switch (less than a second on my system). The script and wallpapoz work at the command line level - the current desktop image is replaced by another one. For a minimal delay switch, the images probably would be stored in memory but that probably requires some coding at a lower level which is beyond my knowledge. Things change fast, maybe some Mint developper will look into this and a solution will appear soon.
In the meantime I can live with a small delay for a non-critical feature.

:-)
jjaythomas

Re: Different background for each workspace?

Post by jjaythomas »

That what I thought
I'm not a programer at all (except a basic cumputer class in tech college, PREMSwindows era, was MSDOS tho) :roll:
I feel old :lol:

J.Jay
User avatar
Dngrsone
Level 5
Level 5
Posts: 574
Joined: Thu Nov 29, 2012 12:18 pm

Re: Different background for each workspace?

Post by Dngrsone »

If it will make you feel any better, my BASIC class was on a TRS-80 Model III... We were fancy because one of our computers had two
720Mb floppy drives.

Sent from my SPH-D710 using Tapatalk 2
Try politeness; people will like you for it.
jjaythomas

Re: Different background for each workspace?

Post by jjaythomas »

Most in class were commodore 64er I think their was a pet also. If remember they (the school) was getting Colts next year. And other classroom had 'apple 2s

J.Jay
User avatar
Dngrsone
Level 5
Level 5
Posts: 574
Joined: Thu Nov 29, 2012 12:18 pm

Re: Different background for each workspace?

Post by Dngrsone »

Ah, good times... I didn't get a C-64 until I was 19 or 20. I went all out and got the monitor and dual floppy drives.

Sent from my SPH-D710 using Tapatalk 2
Try politeness; people will like you for it.
jjaythomas

Re: Different background for each workspace?

Post by jjaythomas »

Ah, good times... I didn't get a C-64 until I was 19 or 20. I went all out and got the monitor and dual floppy drives.

Yea I was out of HS when go into computer (dad bought me C128) I didn't but new of Tandy users! :P Were about even but you edged be out earlier :lol:

J.Jay

P.S went thru Amigaland to BEOS (actually Win 95 played back to BEOS) Back to Windowsworld finally Linux (I think desktop Linux was pretty new/geeky) :roll:

Sorry long-winded (off topic and nostalgic) (had birthday month ago :cry: ) Had older friend had one of those cassette/storage things.
User avatar
peyrol
Level 3
Level 3
Posts: 132
Joined: Sun Nov 25, 2012 1:51 am
Location: Lexington VA USA

Re: Different background for each workspace?

Post by peyrol »

I'm the original poster. I have LMDE 64 bit with MATE.
I downloaded and installed Wallpapoz, and I can run the GUI.
I have defined a directory of images for each workspace, and I saved my changes.
Then I clicked Daemon->restart. I change workspaces and the background stays the same.
The image is supposed to change after one minute, but it does not.
What obvious thing am I missing? The background I get is the same one I had before,
which was selected by issuing the command: mate-appearance-properties %F

Thanks in advance.
jjaythomas

Re: Different background for each workspace?

Post by jjaythomas »

sorry away doing other things for few days... :oops:
I'm the original poster. I have LMDE 64 bit with MATE.
I downloaded and installed Wallpapoz, and I can run the GUI.
I have defined a directory of images for each workspace, and I saved my changes.
Then I clicked Daemon->restart. I change workspaces and the background stays the same.
The image is supposed to change after one minute, but it does not.
What obvious thing am I missing? The background I get is the same one I had before,
which was selected by issuing the command: mate-appearance-properties %F
have you saved changes before restart daemon?
only one monitor/display? or have external monitor hooked to laptop ect.?
on mate I have not used since very early version (was very gnome2 compatible) I'll try on newer (1.4 version) of mate :)

J.Jay
P.S. the first wallpaper will be your 'wallpaper set in mate preferences' the 'walpapoz' ones doesn't take effect till the 1st change to a different desktop (& back). (you can get around that by setting wallpaper the same as 1st in walpapoz the same) :wink:
jjaythomas

Re: Different background for each workspace?

Post by jjaythomas »

Sorry...
on mate I have not used since very early version (was very gnome2 compatible) I'll try on newer (1.4 version) of mate
can't get work on current mate (1.4) :cry: May be code just needs new name for packages? (I'm not a coder unfortunately) :oops:

Does work on LMDE (Xfce) 4.10 (currently using) 4.6 & 4.8 and Hopefully 4.12 when out. also Debians based on squeeze (still gnome2) repos such as 'solus,snow3 ect.

J.Jay
P.S. I use walpapoz 0.6.2 (I think not being worked on anymore)
gcarvell

Mint 16 / MATE

Post by gcarvell »

For anyone using Linux Mint 16 with the MATE desktop, here' a small tweak to Garolou's script above (it was for Mint 13 with Cinnamon).

In function setdesktop(), change the gsettings command to read:

Code: Select all

gsettings set org.mate.background picture-filename "$desktop_dir$1"
There's still a one-second delay every time the background is updated, but it's happening outside of the script. Probably some MATE daemon's scan interval, but I couldn't track it down.

P.S. Nice to see some other old timers here. I got my start on the Apple II+ - great machine. Spent a little time on the TRS-80 Model III as well. My high school got its first computer lab the year *after* I graduated :-)
User avatar
Dngrsone
Level 5
Level 5
Posts: 574
Joined: Thu Nov 29, 2012 12:18 pm

Post by Dngrsone »

For what it is worth, I knuckled down and installed KDE-full over Cinnamon. I have my separate desktop wallpapers and still use the Gnome programs I prefer.

Sent from my SPH-D710 using Tapatalk
Try politeness; people will like you for it.
jtwdyp

Re: Different background for each workspace? openbox too

Post by jtwdyp »

Yes I know this is an old thread But I wanted to thank garolou for sharing his code, and share with him the modifications I made to make this work in openbox on a Mageia Linux System... Since he doesn't accept private messages, this is my best option for doing so...
garolou wrote:Hello everyone,
I just moved from Ubuntu 11.10 to Mint 13 cinnamon. The desktop environment here is more of what I'm looking for. I like the idea of having a different background for each workspace also... so I spent a day to figure out a way to do it - It's not perfect but pretty close.
The script basically monitors a 'change of workspace' and resets the background image to your choice.

Code: Select all

#!/bin/bash
# Workspace desktop image switcher WDIS 1.0
# Script to change the desktop image when switching workspaces.
# Tested on Linux Mint 13 'cinnamon'
desktop_dir="/home/username/.cinnamon/backgrounds/" # full path to images directory; 
desktop_img[0]="boat.jpg"
desktop_img[1]="boat_mirror.jpg"
desktop_img[2]=""
desktop_img[3]=""
# add more images if using more workspaces

setdesktop() {
	gsettings set org.gnome.desktop.background picture-uri "file://$desktop_dir$1"
	}
xprop -root -spy _NET_CURRENT_DESKTOP | (
	while read -r; do
		desk=${REPLY:${#REPLY}-1:1}
		setdesktop ${desktop_img[$desk]}
	done
	)
Modify the paths and image names appropriately.
Let me know if there is any way I can improve the code.

Cheers
Thanks garolou. Your code helped me a LOT.

The script had to be modified to use a different background setting tool for openbox. And since I use 12 desktop areas, I had to modify the while loop to handle both 1 and 2 digit array index values.

I'd like to properly credit garolou for the initial code, but this thread is the closest I'm able to come to that. See http://murga-linux.com/puppy/viewtopic. ... 539#764539...

My Openbox compatible code follows:

Code: Select all

#based on an original script posted to linuxmint forum by garolou
#[url]http://forums.linuxmint.com/viewtopic.php?p=672189#p672189[/url]
# Script to change the desktop image when switching workspaces.
# Tested on Mageia release 3 (Official) for x86_64 Kernel 3.10.28-desktop-1.mga3
# desktop_dir="/usr/share/backgrounds/" # full path to images directory;
desktop_dir="$HOME/0bg/" # full path to images directory;
desktop_img[0]="ChillyLickingGood2001.jpg"
desktop_img[1]="z_optic2.png"
desktop_img[2]="metruck.jpg"
desktop_img[3]="greydragon.png"
desktop_img[4]="ShiloWannaPlay0273.jpg"
desktop_img[5]="snapshot-dragon-storm.png"
desktop_img[6]="DragonlySkyscapes-014.jpg"
desktop_img[7]="DragonlySkyscapes-016.jpg"
desktop_img[8]="FantaScene-006.jpg"
desktop_img[9]="DragonlySkyscapes-018.jpg"
desktop_img[10]="DragonlySkyscapes-019.jpg"
desktop_img[11]="jungle.png"
# add more images if using more workspaces

setdesktop() {
# =>    test
#    display "$desktop_dir$1"
# =>       Mageia
    feh  --bg-scale "$desktop_dir$1"
# =>       fatdog
#    wallpaper "$desktop_dir$1"
}
xprop -root -spy _NET_CURRENT_DESKTOP | (
   while read -r; do
       desk=${REPLY:${#REPLY}-2:2}
       case $desk in
            [0-9][0-9]) setdesktop ${desktop_img[$desk]};;
      *)desk=${REPLY:${#REPLY}-1:1};
      setdesktop ${desktop_img[$desk]};;
       esac
   done
   ) 
lordbonislav

Re: Different background for each workspace?

Post by lordbonislav »

How do I get a script working?
User avatar
Dngrsone
Level 5
Level 5
Posts: 574
Joined: Thu Nov 29, 2012 12:18 pm

Re: Different background for each workspace?

Post by Dngrsone »

Welcome to the forums.

I am assuming that you want to use one of the scripts provided in this thread.

Basically, you want to use a text editor such as gedit to create a file with the script in it. In the case of the scripts seen in this thread, one would copy the entire contents of the 'CODE' box and paste it into the text editor and then save that under a file name.

Then, you would have to modify the properties of that file so that it is executable.
Try politeness; people will like you for it.
lordbonislav

Re: Different background for each workspace?

Post by lordbonislav »

Thank you!
lordbonislav

Re: Different background for each workspace?

Post by lordbonislav »

One more question. How to set the wallpaper streched in this script?
User avatar
Dngrsone
Level 5
Level 5
Posts: 574
Joined: Thu Nov 29, 2012 12:18 pm

Re: Different background for each workspace?

Post by Dngrsone »

I wouuld think that it would either be a setting in Cinnamon, or you'd want to make your wallpapers the same size as your desktop ahead of time.
Try politeness; people will like you for it.
phr33k

Re: Different background for each workspace?

Post by phr33k »

To get your background to be stretched, put the following line in your script after the line where you set the background:

Code: Select all

gsettings set org.gnome.desktop.background picture-options 'stretched'
HTH.
krumm

Re: Different background for each workspace?

Post by krumm »

Slight update to work on Cinnamon in ver 17.1

I was unable to properly escape spaces in the filenames for desktop_img[x]= Probably just slowness on my part...

Code: Select all

#!/bin/bash
# Workspace desktop image switcher WDIS 1.0
# Script to change the desktop image when switching workspaces.
# Tested on Linux Mint 13 'cinnamon'
# update -2015-2-14 switch to org.cinnamon.desktop.background; tweak desktop_dir; tested on Linux Mint 17.1 cinnamon

desktop_dir=~/.cinnamon/backgrounds/ # full path to images directory;
desktop_img[0]="Galaxy.jpg"
desktop_img[1]="Brushes.jpg"
desktop_img[2]="Shapes.jpg"
desktop_img[3]="Rice_Paddy.jpg"
# add more images if using more workspaces

setdesktop() {
   gsettings set org.cinnamon.desktop.background picture-uri "file://${desktop_dir}${1}"
   }
xprop -root -spy _NET_CURRENT_DESKTOP | (
   while read -r; do
      desk=${REPLY:${#REPLY}-1:1}
#echo "DESKTOP = $desk"
      setdesktop ${desktop_img[${desk}]}
   done
   )

Save the script to a file, I call it bgswitcher.sh
make it executable ( chmod +x bgswitcher.sh )

Then add it to Startup Applications in System settings.
add_startup_app.png
Include the ampersand (&) after the path so that it runs in the background.

Now when you log in, you're all set.
mideal
Level 3
Level 3
Posts: 120
Joined: Fri Jan 18, 2013 10:28 am
Location: Germany - Wilhelmshaven & Frankfurt
Contact:

Re: Different background for each workspace?

Post by mideal »

Garalou's script works fine in Cinnamon 17.1 for me.
Fast enough even on my 6 year old Thinkpad.
If you'd create a RAM disk at startup and copy your backgrounds to it,
switching will even be faster.

But the whole thing would be much nicer if you could also have different sets of icons per workplace,
e.g. links to manuals, sources and dev tools for your developer workplace,
music, videos and audio software for your creative workplace ...

Couldn't the desktop config file be copied and switched per workplace, too?

Added:
When switching workplaces, the task bar does only show programs active on this workplace,
so the list of active programs, and/or the taskbar must be stored somewhere and switched over.
That may be a entry point to start switching the background and the set of desktop icons, too.
Last edited by mideal on Wed May 20, 2015 12:59 pm, edited 1 time in total.
Yoga 910 16GB/2TB running Mint 20.3 Cinnamon 64Bit
__________________________
…trust me - I’m the sunscreen.
Locked

Return to “LMDE Archive”