You are not logged in.
Every now and then pcmanfm --desktop crashes and since it handles my desktop, I'd like it to restart automatically, followed by conky (which disappears when pcmanfm crashes).
Is there a way to do this?
Offline
http://sourceforge.net/tracker/index.ph … tid=801864
This bug has been reported for quite some time now. Unfortunately, it seems that
pcmanfm doesn't receive any development at the moment
Offline
Ok, but I suppose we could find a way around it.
For example, if emerald crashes, I think this run command will ensure it restarts:
while true; do emerald --replace; sleep 1; done &
PS
I am not sure the bug from this link is the same as mine. Mine crashes randomly, sometimes days apart, when I click on the desktop or sometimes even when I do nothing, but it is perfectly usable otherwise.
Last edited by Lockheed (2011-06-28 11:03:59)
Offline
you can create a script which checks the pidof pcmanfm -desktop..and if it doesn't find it then restart it. Keep running that script in a while loop like above.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
So, would it be something like this?
while true; do pcmanfm --desktop; sleep 1; done &
Last edited by Lockheed (2011-06-28 12:48:17)
Offline
That would create a lot of instances, I believe. Write a script which simply checks if the pidof pcmanfm exists. If it does, do nothing, else start pcmanfm --desktop.
The only flaw I see in that is that if you have pcmanfm (the actual file manager) running -- then its going to give you false positives. Try to see if pcmanfm --desktop generates a separate pid for itself.
#!/bin/sh
##This below line is where you need to check if pcmanfm --desktop provides a separate pid or if you will have to use the pcmanfm's pid.
PID = "$(pidof pcmanfm)"
if [ -n $PID ]; then
echo "pcmanfm has not crashed"
else
echo "pcmanfm has crashed, so restarting"
pcmanfm --desktop
fi
Save this script in a file. Make it executable and then run this script in the while loop that you have in your post above.
I haven't run this code and also my bash skill isn't good, so it may work -- it may not
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
As far as I can see form Task Manager, PID for pcmanfm (and --desktop) is assigned randomly, different at every run.
Offline
As far as I can see form Task Manager, PID for pcmanfm (and --desktop) is assigned randomly, different at every run.
That's fine. The if clause in the script is only checking if the pid exists and is not comparing it to any value.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
Ok, you outrun my ability to understand linux lingo. I guess I will just have to manually restart it when it crashes or switch to another file manager. Any suggestions?
Offline
Ok, you outrun my ability to understand linux lingo. I guess I will just have to manually restart it when it crashes or switch to another file manager. Any suggestions?
Have you even tried the script that I gave you ?
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
Lol, I totally missed that script. Let me see...
Offline
Apparently, it falls into some failed loop:
bash: line 4: /home/juha/bin/pcman: Permission denied
bash: line 4: /home/juha/bin/pcman: Permission denied
bash: line 4: /home/juha/bin/pcman: Permission denied
bash: line 4: /home/juha/bin/pcman: Permission denied
bash: line 4: /home/juha/bin/pcman: Permission denied
bash: line 4: /home/juha/bin/pcman: Permission denied
Offline