# HG changeset patch # User Aleksej Bobylev # Date 1431432351 -10800 # Node ID df54c758feb849036b0df149c4c0a71ae02afc6d # Parent b9a33d89d025d8c9a73a0a5536c7584b5a90f27f settings.cgi: restart_lxpanel fix - respect LXPanel profile, restart LXPanel only if current TazPanel user started it. diff -r b9a33d89d025 -r df54c758feb8 settings.cgi --- a/settings.cgi Tue May 12 13:54:08 2015 +0200 +++ b/settings.cgi Tue May 12 15:05:51 2015 +0300 @@ -30,7 +30,14 @@ restart_lxpanel() { # `lxpanelctl restart` exists, but it breaks often leaving us without any panel - killall lxpanel; DISPLAY=':0.0' lxpanel & + lxpanel_pid="$(ps -o comm,pid | fgrep lxpanel | awk '{print $2}')" + lxpanel_user="$(ps -o comm,user | fgrep lxpanel | awk '{print $2}')" + lxpanel_comm="$(ps -o pid,args | grep -e "^\ *$lxpanel_pid " | awk '{$1="";print}')" + + if [ "$USER" == "$lxpanel_user" ]; then + kill $lxpanel_pid + DISPLAY=':0.0' XAUTHORITY='/var/run/slim.auth' $lxpanel_comm 1>/tmp/debug1 2>/tmp/debug2 & + fi } @@ -122,6 +129,7 @@ if [ ! -e "$lxpanel" ]; then mkdir -p "$lxpanel"; cp /etc/lxpanel/default /etc/lxpanel/slitaz $lxpanel fi + for panel in $(find $lxpanel -type f -iname panel); do awk -vicon="/usr/share/pixmaps/$(GET tweak).png" ' BEGIN{ found = "0"; }