You are not logged in.
Hi,
I wrote a simple script to save/restore icon positions (they get all messed up when changing resolutions):
...
case "$1" in
"save")
mkdir -p ~/.config/xfce4/desktop.bak
cp -vf ~/.config/xfce4/desktop/icons* ~/.config/xfce4/desktop.bak
;;
"load")
# check whether non-empty backup directory exists
if [[ -d ~/.config/xfce4/desktop.bak ]] && [[ "$(ls -A ~/.config/xfce4/desktop.bak)" ]]
then
[[ $(cp -vf ~/.config/xfce4/desktop.bak/icons* ~/.config/xfce4/desktop) ]] && \
echo "Backup directory '~/.config/xfce4/desktop.bak' restored." <& 2 && \
echo "You must log out and log in again for changes to take effect." <& 2
else
echo "Backup directory '~/.config/xfce4/desktop.bak' not found or empty. Nothing was loaded." <& 2
fi
;;
"help"|"h")
show_help
;;
esac
But I do not know how to force the session manager to re-read the yaml file containing the icon positions (~/.config/xfce4/desktop/icons.screen0.yaml).
I have to log out and log back in to force the file to be read.
Is it possible to do so without logging out?
Thanks
Last edited by ffcc (2025-01-09 13:11:43)
Offline
Hello and welcome.
Does reloading all the settings work?
xfdesktop -R
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
Hello and welcome.
Does reloading all the settings work?
xfdesktop -R
No, it does not. I still need to log out and log back in to force the yaml to be read.
Offline
It might be a good idea to create a bug report since the "-R" parameter is supposed to re-read all the settings. In the meantime, to avoid having to logout and back in, you could run something like:
pgrep xfdesktop && (xfdesktop -Q; xfdesktop &) || xfdesktop &
...to restart the xfdesktop process.
One additional note: there is currently a bug, or rather an weak optimization in the code where the drawing of the desktop is slower in 4.20 than in previous versions. To bypass this, set Color to "Transparent" in the Desktop Settings > Background tab even if you are using an image. This will speed up the restart of the xfdesktop process. https://gitlab.xfce.org/xfce/xfdesktop/-/issues/347 if you're interested.
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
It might be a good idea to create a bug report since the "-R" parameter is supposed to re-read all the settings. In the meantime, to avoid having to logout and back in, you could run something like:
pgrep xfdesktop && (xfdesktop -Q; xfdesktop &) || xfdesktop &
...to restart the xfdesktop process.
One additional note: there is currently a bug, or rather an weak optimization in the code where the drawing of the desktop is slower in 4.20 than in previous versions. To bypass this, set Color to "Transparent" in the Desktop Settings > Background tab even if you are using an image. This will speed up the restart of the xfdesktop process. https://gitlab.xfce.org/xfce/xfdesktop/-/issues/347 if you're interested.
Thank you so much. Restarting xfdesktop via command line works as a charm as it restarts right away in less than a second.
PS: I did not set the background color to "Transparent" to speed up the restart process. Doing so did not make a big difference.
I'll mark this as SOLVED.
Offline
It might be a good idea to create a bug report since the "-R" parameter is supposed to re-read all the settings. In the meantime, to avoid having to logout and back in, you could run something like:
pgrep xfdesktop && (xfdesktop -Q; xfdesktop &) || xfdesktop &
...to restart the xfdesktop process.
Fantastic, worked for me too.
Before I freeze my icons.screen0.yaml in my "on-login" autostart script using chattr +i, set my custom display settings using xrandr followed by unfreezing the icons.screen0.yaml using chattr -i, it also needed another line that restarts xfdesktop as you proposed. It otherwise never worked. Stable desktop icons now, great.
In order to ensure that xfdesktop restarts only after it has been fully exited (exit 0), I use a slightly modified version on my system:
pgrep xfdesktop && xfdesktop -Q && trap 'xfdesktop &' EXIT || xfdesktop &
Thanks for sharing.
Cheers
Marculix
Last edited by Marculix (2025-03-05 09:17:17)
Offline
[ Generated in 0.042 seconds, 8 queries executed - Memory usage: 549.41 KiB (Peak: 550.26 KiB) ]