#!/bin/ash
#180929b sfs
rm "/home/`sfsusr`/.cache/menus/"* 2>/dev/null
killall menu-cached 2>/dev/null && exit


if [ "`pidof mate-panel`" ];then         
    sfs-testrun xxkb
        mate-panel --replace &
    sfs-testrun xxkb
elif [ "`pidof vala-panel`" ];then
    sudo -u "`sfsusr`" vala-panel -c restart &
elif [ "`pidof jwm`" ];then
    pidof menu-dmn || menu-dmn start & 
elif [ "`pidof xfce-panel`" ];then
    sudo -u $(sfsusr) sh -c "
       $(ps -C xfdesktop ewwww --no-headers \
         |sed -n 's/^.* \(xfdesktop\) \(.*\)$/\2 \1 -R/p')
       $(ps -C xfce4-panel ewwww --no-headers \
         |sed -n 's/^.* \(xfce4-panel\) \(.*\)$/\2 \1 -r/p')"
fi