#!/bin/bash
# restarts spacefm, including desktop control,
# in case window or desktop crashes
#
# looks for running instance of spacefm (desktop) -- 
# ignores the output in ps of the grep inquiry itself :)
#
x=`ps aux | grep "spacefm --desktop" | grep -v "grep"`
# runs the desktop command if not found
if [ -z "$x" ];then
	spacefm --desktop&
	sleep 1
fi
# then opens home directory in spacefm 
spacefm -w $HOME&
