You are not logged in.

#1 2016-09-06 20:45:00

relaxicanfixit8
Member
From: Indiana, United States
Registered: 2015-10-18
Posts: 2

Xfce: Run Script After Desktop Icons Load

I am using my Xfce desktop as a location for filesystem and removable disk icons.  Obviously the removable disk icons will vary, but there are some icons such as ~ and / which will always be present, and I'd like to lock them in certain places.  However, I found that the icons are always rearranged when I log in.

To solve this, I first tried removing all old icons* configurations from

~/.config/xfce4/desktop/

and then setting the immutable attribute on the folder.  This has been effective at preventing changes to the configuration, but it seems that Xfce does not automatically source this folder when generating the disk icons, as they continue to appear in an automatically-arranged manner.

After taking the above step, I can run

xfdesktop --reload

to return the icons to my desired configuration, but I must do this manually.  So my next step was to place an executable script in

~/.config/autostart/

which contains the following:

#!/bin/bash
xfdesktop --reload

This has no effect; considering that my autostart script for launching ksuperkey works as expected, I believe that the script is being run before the desktop icons are generated.  Lastly, I tried rewriting the script so that it would wait for a certain program to load, in hopes that the program would launch after the icons are placed.  I decided on dockx, as it is one of the last autostart programs to load:

#!/bin/bash
until p=$(pgrep dockx)
do
     sleep 1
done
sleep 1
xfdesktop --reload

This, too, is failing.  As I said, dockx is one of the last autostart programs to load, so I don't have many more options for timing an autostart script.  I have heard that it is possible to time a script relative to boot or login time, but that method seems incredibly sloppy and I would like to avoid it if possible.  Is there any way to ensure that my

xfdesktop --reload

runs at a time when it will be effective, or is there another way for me to force these icons to retain their position?


There's no place like 127.0.0.1.

Offline

Board footer

Powered by FluxBB