Sorry if seems confusing but I'm trying to get your great ideas in sync! Really want to see this work! I'll test out both your ideas ASAP!
jimwg
Member
Registered: 2011-12-11
Posts: 36
Email
Re: Different Desktop Backgrounds Not XFCE Possible?
ToZ wrote:
Try this simple memory-resident script. You can load it manually from the terminal or add it to your startup applications. It cycles continously and every second checks to see if the workspace has changed (using wmctrl) and if so, changes the wallpaper. Not ideal, but it will work.
You need to edit the script to change NUMBER_WORKSPACES to be the number of workspaces that you have and also edit the values in the WORKSPACE_WALL array to point to the wallpapers that you want to use for every workspace.
#!/bin/bash
# The Poor Man's Wallpaper/Workspace solution
# Requires: wmctrl
# Make sure you edit the NUMBER_WORKSPACES and WORKSPACE_WALL array to suit.
# Remember: Xfce starts counting workspaces at 0.
lockfile=/tmp/.wspm.lockfile
if ( set -o noclobber; echo "locked" > "$lockfile") 2> /dev/null; then
trap 'rm -f "$lockfile"; exit $?' INT TERM EXIT
echo "Locking succeeded" >&2
###### EDIT THESE VALUES
NUMBER_WORKSPACES=4
WORKSPACE_WALL[0]=/usr/share/backgrounds/space-01.jpg
WORKSPACE_WALL[1]=/usr/share/backgrounds/space-02.jpg
WORKSPACE_WALL[2]=/usr/share/backgrounds/space-03.jpg
WORKSPACE_WALL[3]=/usr/share/backgrounds/space-04.jpg
###### DO NOT EDIT BELOW
CURRENT_WORKSPACE=$(wmctrl -d | grep \* | cut -d' ' -f1)
while true
do
sleep 1
NEW_WORKSPACE=$(wmctrl -d | grep \* | cut -d' ' -f1)
if [ $CURRENT_WORKSPACE -ne $NEW_WORKSPACE ]; then
wmctrl -s $NEW_WORKSPACE
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s ${WORKSPACE_WALL[$NEW_WORKSPACE]}
CURRENT_WORKSPACE=$NEW_WORKSPACE
fi
done
rm -f "$lockfile"
else
echo "Lock failed - exit" >&2
exit 1
fi
Using Nadia XFCE but doesn't seem to work. sad No images outside regular wallpaper shows. The Workspace Switcher menu doesn't seem to list 0 as a start number, just 1 to 4. Could that be a hangup? Just wildly guessing and will check out more.
Jim in NYC
Last edited by jimwg (Today 08:18:01)
Online
Report
Delete
Edit
Quote
#8 Today 09:00:01
ToZ
Member
Registered: 2011-06-02
Posts: 256
Email
Re: Different Desktop Backgrounds Not XFCE Possible?
Although the Workspace switcher lists the workspaces as 1 to 4, internally they are managed as 0 to 3.
1. Do you have a single monitor setup?
2. Can you post back your edited version of the script?
3. Can you run the following commands and post back the results?
xfconf-query -c displays -p /Default -l | cut -d'/' -f3 | uniq | wc -l
wmctrl -d
wmctrl -d | grep \* | cut -d' ' -f1
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path
ps -ef | grep xfdesktop
4. Can you run this command and see if it changes the wallpaper:
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s /path/to/image/file
...replace /path/to/image/file with the path to an actual wallpaper file.
Offline
Report
Quote
#9 Today 09:20:38
jimwg
Member
Registered: 2011-12-11
Posts: 36
Email
Re: Different Desktop Backgrounds Not XFCE Possible?
ToZ wrote:
Although the Workspace switcher lists the workspaces as 1 to 4, internally they are managed as 0 to 3.
1. Do you have a single monitor setup?
2. Can you post back your edited version of the script?
3. Can you run the following commands and post back the results?
xfconf-query -c displays -p /Default -l | cut -d'/' -f3 | uniq | wc -l
wmctrl -d
wmctrl -d | grep \* | cut -d' ' -f1
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path
ps -ef | grep xfdesktop
4. Can you run this command and see if it changes the wallpaper:
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s /path/to/image/file
...replace /path/to/image/file with the path to an actual wallpaper file.
jimwg@bluemint1 ~ $ xfconf-query -c displays -p /Default -l | cut -d'/' -f3 | uniq | wc -l
1
jimwg@bluemint1 ~ $ wmctrl -d
0 * DG: 1024x768 VP: 0,0 WA: 0,0 1024x768 Workspace 1
1 - DG: 1024x768 VP: N/A WA: 0,0 1024x768 Workspace 2
2 - DG: 1024x768 VP: N/A WA: 0,0 1024x768 Workspace 3
3 - DG: 1024x768 VP: N/A WA: 0,0 1024x768 Workspace 4
jimwg@bluemint1 ~ $ wmctrl -d | grep \* | cut -d' ' -f1
0
jimwg@bluemint1 ~ $ xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path
/path/to/image/file
jimwg@bluemint1 ~ $ ps -ef | grep xfdesktop
jimwg 7220 7191 0 08:06 ? 00:00:01 xfdesktop --display :0.0 --sm-client-id 24c961fc5-264d-4941-b143-8e985c032848
jimwg 7937 7879 0 09:09 pts/0 00:00:00 grep --colour=auto xfdesktop
jimwg@bluemint1 ~ $
jimwg@bluemint1 ~ $ xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s /usr/share/backgrounds/stars.jpg
Works displaying stars.jpg
Also -- using a user's slightly modified version by caribriz from LinuxMint:
Jim - I'm no techie either
- but I had a go at the solution by ToZ in both a flash drive full install of LM13 xfce and a live LM14 xfce.
It seems to work - with just a minor lag when switching desktops.
If interested, this is how I did it for LM14 xfce - your mileage may vary ....
Note: for the experiment I just used three of the images in LM14 /usr/share/backgrounds for Workspaces 1, 2 and 3
.... I left Workspace 0 as the original desktop wallpaper, gelsan_green.png - the images are different for LM13 xfce:
Added Workspace Switcher to panel, went to Settings > Workspaces and made 4 sure workspaces were enabled (should be by default ?)
Open terminal, enter commands:
sudo apt-get install wmctrl
mkdir .scripts
cd .scripts
gedit workspace-wall-change
gedit opens .... copied/pasted the text below -
Code: Select all
#!/bin/bash
# The Poor Man's Wallpaper/Workspace solution by ToZ
# Requires: wmctrl
# Make sure you edit the NUMBER_WORKSPACES and WORKSPACE_WALL array to suit.
# Remember: Xfce starts counting workspaces at 0.
lockfile=/tmp/.wspm.lockfile
if ( set -o noclobber; echo "locked" > "$lockfile") 2> /dev/null; then
trap 'rm -f "$lockfile"; exit $?' INT TERM EXIT
echo "Locking succeeded" >&2
###### EDIT THESE VALUES
NUMBER_WORKSPACES=4
WORKSPACE_WALL[0]=/usr/share/backgrounds/gelsan_green.png
WORKSPACE_WALL[1]=/usr/share/backgrounds/sparks.jpg
WORKSPACE_WALL[2]=/usr/share/backgrounds/stars.jpg
WORKSPACE_WALL[3]=/usr/share/backgrounds/water.jpg
###### DO NOT EDIT BELOW
CURRENT_WORKSPACE=$(wmctrl -d | grep \* | cut -d' ' -f1)
while true
do
sleep 1
NEW_WORKSPACE=$(wmctrl -d | grep \* | cut -d' ' -f1)
if [ $CURRENT_WORKSPACE -ne $NEW_WORKSPACE ]; then
wmctrl -s $NEW_WORKSPACE
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s ${WORKSPACE_WALL[$NEW_WORKSPACE]}
CURRENT_WORKSPACE=$NEW_WORKSPACE
fi
done
rm -f "$lockfile"
else
echo "Lock failed - exit" >&2
exit 1
fi
saved file (you're already in .scripts folder, so just clicked save) > closed gedit
in same terminal, make the file executable:
chmod +x workspace-wall-change
exit terminal
Settings > Session and Startup > Application Autostart > click Add
type in name: workspace-wall-change
in command type in: /home/your-own-username/.scripts/workspace-wall-change
click ok
click Session tab > click Save session
logout/in
When trying it in LM13 xfce I somehow managed to "lose" my window settings as I have done at times in the past ...
I just opened a terminal and entered xfwm4
So - it worked for me - see how you go.
=========================================================
Top
Re: Different Backgrounds On Different Desktops Not Possible
Unread postby caribriz on Tue Jun 25, 2013 8:52 am
jimwg wrote:Using Nadia XFCE but doesn't seem to work. sad Maybe my workspace image addresses from Pictures folder are too long or the script only works with images inside usr folder? Or does desktop wallpaper menu have to be set to single image or none? The Workspace Switcher menu doesn't seem to list 0 as a start number, just 1 to 4. Could that be a hangup? Just wildly guessing and will check out more.
Jim in NYC
Hi Jim -
Just tried it again, a few different times in LM14 xfce (live).
The first time it didn't work
- so rebooted, and tried again.
2nd time - did work - this was as I posted above - with the 4 images in /usr/share/backgrounds.
Rebooted and tried again.
3rd time - this time I tried it with the same images as before, but located in /home/mint/Pictures - I copied the 4 images from /usr/share/backgrounds to /home/mint/Pictures and edited workspace-wall-change script image lines to read:
Code: Select all
###### EDIT THESE VALUES
NUMBER_WORKSPACES=4
WORKSPACE_WALL[0]=/home/mint/Pictures/gelsan_green.png
WORKSPACE_WALL[1]=/home/mint/Pictures/sparks.jpg
WORKSPACE_WALL[2]=/home/mint/Pictures/stars.jpg
WORKSPACE_WALL[3]=/home/mint/Pictures/water.jpg
Saved the file, and continued the instructions as before.
It worked again.
In Desktop settings - on each occasion, it was set as "single image".
In Workspace Switcher menu, it is listed as 1 to 4 - contrary to what is in the script - "# Remember: Xfce starts counting workspaces at 0."
This was the result, regardless of whether the images were located in /usr/share/backgrounds OR /home/mint/Pictures:
workspaces 1 and 2.png
LM14 xfce workspaces 1 and 2
workspaces 3 and 4.png
LM14 xfce workspaces 3 and 4
As I said, this was done on a live usb of LM14 xfce, but I did do it as well in full install of LM13 xfce.
So, I'm not sure why it didn't work for me first time - it's working now.
Maybe you could start over and try to recreate what I did exactly - using the same images in /usr/share/backgrounds - just to see if that works?