Xfce forgets desktop icons positions

Sometimes, after logging out and in, Xubuntu forgets the positions of the desktop icons and re-arranges them on top-left as default.

I have tried a proposed solution on a similar subject. This locks the icons that were on desktop when I ran the command but not the newer icons.

What could I do to permanently fix this issue? I use Xubuntu 12.10 with xfce 4.12.


Solution 1:

The problem seems to have been solved in the 13.04 edition, but the "semi-solution" I had used made the problem persist. If you have the same problem, try deactivating the lock:

sudo chattr -i ~/.config/xfce4/desktop/icons*

Solution 2:

There is a good solution on ubuntuforums from go4unkwn2: http://ubuntuforums.org/showthread.php?t=2232021

He wrote two scripts, one for backing up ~/.config/xfce4/desktop/icons* files, and second for writing them back from the backup.

I would just add a small enhancement - make an entry in /etc/lightdm/lightdm.conf to run the first script at xfce session end, so you don't have to run it manually every time you want to save icon positions: add or edit line:

session-cleanup-script=your_script_to_save_desktop_icons_position.sh

For restoring icon positions, you can run the second script at session startup, as go4unkwn2 suggests, by adding an entry in Settings/Session and Startup