You are not logged in.


Using Xfce 4.20. Between sessions, the desktop stores both icon positions (column and row) and identities (icon name and nature, like "FileA" and "link to /home/..." etc.
Thunar seems to store the identities, but I don't know where it keeps its ~/Desktop items.
In ~/.config/xfce4/desktop/icons.screen0.yaml there is a list of icon names and positions, but the list includes seemingly every icon ever put on the desktop.
How does xfce4 know what icons to put on the desktop, and where, from session to session? If there is no single file with this information, how does the "restore routine" get only the *current* icons from that YAML file?
I ask because I want a portable method for carrying icon position and identities across an OS update.
Many thanks in advance for any advice.
Last edited by gnome_refugee (2026-04-06 21:37:31)
Offline


Yes, in 4.20, xfdesktop uses the icons.screen0.yaml file.
but the list includes seemingly every icon ever put on the desktop.
That was recently fixed: https://gitlab.xfce.org/xfce/xfdesktop/ … 52d233aa54, but hasn't been released it (it exists in master branch and will be released at the next version of xfdesktop).
How does xfce4 know what icons to put on the desktop, and where, from session to session? If there is no single file with this information, how does the "restore routine" get only the *current* icons from that YAML file?
Icons are drawn to the desktop within a row/column grid. Within the file above, you can see the row/column grid locations for each file. It places the icon in that grid location.
I ask because I want a portable method for carrying icon position and identities across an OS update.
Can you explain what you mean by this?
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline


@ToZ, many thanks for confirming that desktop icons are drawn (positioned) from the row and col numbers in icons.screen0.yaml. But the nature of an icon isn't in the YAML, which only has a label, like "/home/ToZ/special-stuff/some-file.txt". The nature of the icon - whether it's a file or a symlink to a file - isn't in the YAML. By "nature" I mean "what happens when you click on the icon".
So when a session begins and Xfce restores the desktop icons to their expected places, it uses icons.screen0.yaml to get positions and labels only, and icon natures from somewhere else.
What I'm after is a way to capture all the desktop icon information in a text file that either I or Xfce can use to re-create the current locations, labels and natures of the desktop icons on an otherwise blank desktop, like the one you get after an upgrade from Debian 12 to Debian 13. I'm imagining that portable text file as a table with 5 columns: row, column, label, full path to target, nature of icon.
I can build that table by combining the YAML with the information from the command ls -al, given my current desktop. But Xfce must save nature+positions between sessions somewhere. Where and how?
Last edited by gnome_refugee (2026-04-06 03:49:28)
Offline


The nature of the icon - whether it's a file or a symlink to a file - isn't in the YAML. By "nature" I mean "what happens when you click on the icon".
xfdesktop will "execute" that icon - the action would depend on the type of icon it is:
- .desktop file = launch it (execute the "Exec=" line of that file
- regular file = open it in the default associated app
- link = open the link in the file manager
So when a session begins and Xfce restores the desktop icons to their expected places, it uses icons.screen0.yaml to get positions and labels only, and icon natures from somewhere else.
It's not a label that is in the yaml file, but rather the path to a file/folder/link
"/home/toz/Desktop/test.txt":
row: 2
col: 16What I'm after is a way to capture all the desktop icon information in a text file that either I or Xfce can use to re-create the current locations, labels and natures of the desktop icons on an otherwise blank desktop, like the one you get after an upgrade from Debian 12 to Debian 13. I'm imagining that portable text file as a table with 5 columns: row, column, label, full path to target, nature of icon.
You must not edit or manually change the yaml file while xfdesktop is running. So stop xfdesktop first ("xfdesktop -Q"), then copy/backup the yaml file along with the contents of ~/.config/xfce4/desktop, and restore those to some other system where xfdesktop also isn't running. Then, when xfdesktop starts, it will read the yaml file, and display the icons in the proper place.
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline


@ToZ, really appreciate your patience with me on this, but I'm still not clear on what's happening. Thanks, too, for correcting my use of "label".
Suppose you have a blank desktop with no icons. Suppose you have the file /home/toz/Temp/myfile.txt. You create a link to the file on your desktop. You now have an icon file on your desktop at top left. On my ext4 system this symlink file would have a size of 25 bytes.
The YAML file now has the entry
"/home/ToZ/Desktop/myfile.txt":
row: 0
col: 0
but there's no other new entry in ~/.config/xfce4/desktop that represents this symlink file.
The YAML has the target data and the icon position. xfdesktop could get the label for the icon by stripping off the "/home/ToZ/Desktop/" string, but I don't see how xfdesktop would know that this icon represents a symlink, or know that the target is /home/ToZ/Temp/myfile.txt.
This information must be stored somewhere other than the YAML file. Is it Thunar? So when a new session starts, Thunar must be running before the desktop icons will launch correctly when clicked?
If you delete the target file /home/ToZ/Temp/myfile.txt, the symlink file and the icon on the desktop will persist but the file manager will flag the symlink as an empty document.
If you now create a new file "myfile.txt" somewhere other than /Temp, the desktop icon won't link to it, because it "knows" (from Thunar?) that the symlink has the target /home/ToZ/Temp/myfile.txt.
So to migrate a set of desktop icons to a new system and have them all work properly I would need to also carry over the file structure and content I currently have (and Thunar?). With a "blank" new system, if I do as you suggest with the YAML, I'll get icons at the expected positions, but xfdesktop will not know if an icon is a symlink or not. The desktop icons used won't have the little arrow indicating a symlink.
Have I got that right? Thanks again for your patience!
Offline


The YAML has the target data and the icon position. xfdesktop could get the label for the icon by stripping off the "/home/ToZ/Desktop/" string, but I don't see how xfdesktop would know that this icon represents a symlink, or know that the target is /home/ToZ/Temp/myfile.txt.
It knows its a link, because in the filesystem, its a link.
ls -l ~/Desktop
lrwxrwxrwx 1 toz toz 24 Apr 6 15:45 myfile.txt -> /home/toz/tmp/myfile.txtSo to migrate a set of desktop icons to a new system and have them all work properly I would need to also carry over the file structure and content I currently have (and Thunar?). With a "blank" new system, if I do as you suggest with the YAML, I'll get icons at the expected positions, but xfdesktop will not know if an icon is a symlink or not. The desktop icons used won't have the little arrow indicating a symlink.
If you copy everything over, the link will still point to the link location (target) on the new system. You will need to ensure that the link target also exists on your new system.
Its really a matter of making sure you copy over all the necessary information and files to re-create the setup on another system. With respect to links, its on you to ensure the link targets also exist in the new system.
Mark solved threads as [SOLVED] to make it easier for others to find solutions.
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline


@ToZ, much obliged. I didn't appreciate how integrated the Xfce DE is.
Offline
[ Generated in 0.175 seconds, 7 queries executed - Memory usage: 568.06 KiB (Peak: 585.04 KiB) ]