1

I am running Linux Mint with "Gnome Classic", I guess it's Gnome 2. I am currently using 3 workspaces, and I have nautilus handling my desktop.

The problem is that my desktop is overloaded with files. And I prefer not having to store them in directories, as that would make one more window to open before accessing the file, I already have too many open.

Can I change the "Desktop" directory for each workspace? Or maybe extend the desktop on the 3 workspaces, so that I can move each icon on the workspace I need?

Do I have to change desktop managers? Or let another file browser than nautilus do the job (how would I do that?) ?

Thanks. (and btw I'm new to using linux, if there's a better approach, please do say so)

EDIT: This is what env | grep XDG gave me (nothing about a desktop):

jad@jad-PC ~ $ env | grep XDG
XDG_SESSION_COOKIE=95dcb1ee36841dd22e3633040000000d-1337336042.360588-45732386
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_CONFIG_DIRS=/etc/xdg/xdg-gnome-classic:/etc/xdg
XDG_DATA_DIRS=/usr/share/gnome-classic:/usr/share/gnome:/usr/local/share/:/usr/share/
XDG_CURRENT_DESKTOP=GNOME

I also tried env | grep Desktop, which gave me nothing.

2

I don't think there's a less hackish solution involving Nautilus than this one:

As far as I can see, Nautilus displays what XDG tells it your desktop is (see env | grep XDG; but let's assume it's ~/Desktop) and there seems to be now way to change this setting without restarting Nautilus.

You can (probably, untested) change what ~/Desktop on changing your workspace. What I have in mind is roughly the following, replacing the Desktop folder with a symlink:

  • Create shortcuts for changing the workspaces, i.e. Ctrl+1 executes ~/bin/switch-to-workspace-one.sh,
  • which would be a shell script you write, that:
    1. changes the symlink Desktop to, say, ~/Workspaces/One and
    2. calls wmctrl to make metacity (the window manager) change to workspace 1

(...analogous for 2 and 3).. I am completely uncertain whether this might have bad consequences by violating assumptions of other programs, since it's a fairly non-standard hack. (There would be more things to take care of, e.g. switching the symlink back to Workspace one on logout (or on boot)...)

But since GNOME2 has had its best days, it might be advisable to look for an alternative, unfortunately, I don't know if other desktop managers can do this. (I had hopes for XFCE, but it seems to be impossible.)

(XMonad has "topic spaces" but this only affects default directories spawned programs find themselves in etc, there are no icons at all.)

  • Thanks for the reply. What if I didn't use Nautilus? (I have no problem switching to Cinnamon or anything, maybe it's not even necessary). And what about Gnome 3? I guess hacky solutions will be my last resort, but I like it :) – jadkik94 May 18 '12 at 14:20
  • 1
    I think I remember KDE4 being able to do that (at least using folder view widgets and activities). But that's quite a leap from GNOME2/3. – sr_ May 18 '12 at 14:23
  • Oh, and see my edit, the commands you suggested did not give me the expected output... And do you know anything about Cinnamon extensions? It's linuxmint's so maybe I should be looking that way? – jadkik94 May 18 '12 at 14:27
  • You are right, KDE is not an option. Thanks anyway. – jadkik94 May 18 '12 at 14:28
  • I suppose it's not important what XDG thinks as long as ~/Desktop is what Nautilus displays. – sr_ May 18 '12 at 14:33
0
#!/bin/bash  
# Workspace desktop image/directory switcher  
# Script to change the desktop image and icons when switching workspaces  
# Tested on Linux Mint 19 Tara 'cinnamon'  
# Amended script of person or persons unknown based on the script by garolou from:  
# https://forums.linuxmint.com/viewtopic.php?t=118540#p672189  
# Sometimes icons did not appear on desktop so I added the line after do"  
# to correct this   
# Before using you must add more desktops to /home/username/  
# Desktop0 Desktop1 etc  
# Do not delete Desktop folder  
# Icons may be copied to other desktops from Desktop   
# May be added to startup applications by using path  
# /bin/bash -c "sleep 10&&/home/a/Desktops"  
# Edit paths according to your username.  
# I call this Desktops but of course you don't need to use this name  

desktop_dir="/home/a/.cinnamon/backgrounds/" # full path to images directory;  
desktop_img=(1.jpg 2.jpg 3.jpg 4.jpg 5.jpg) # add more images if using more workspaces less images required if using less workspaces  

setdesktop() {  
gsettings set org.gnome.desktop.background picture-uri "file://$desktop_dir$1"

}
xprop -root -spy _NET_CURRENT_DESKTOP |
while read -r; do
gsettings set org.nemo.desktop show-desktop-icons false
desk="${REPLY: -1}" #get workspace number
setdesktop "${desktop_img[$desk]}" #set desktop image
gsettings set org.nemo.desktop show-desktop-icons false
sed -i '/\(^XDG_DESKTOP_DIR="$HOME/Desktop)[^"]*"/s//\1'"$desk"'"/' ~/.config/user-dirs.dirs #change XDG_DESKTOP_DIR
gsettings set org.nemo.desktop show-desktop-icons true #show icons
done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.