tazpanel rev 489
settings.cgi: restart_lxpanel fix - respect LXPanel profile, restart LXPanel only if current TazPanel user started it.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue May 12 15:05:51 2015 +0300 (2015-05-12) |
parents | b9a33d89d025 |
children | 2874c858a6b2 |
files | settings.cgi |
line diff
1.1 --- a/settings.cgi Tue May 12 13:54:08 2015 +0200 1.2 +++ b/settings.cgi Tue May 12 15:05:51 2015 +0300 1.3 @@ -30,7 +30,14 @@ 1.4 1.5 restart_lxpanel() { 1.6 # `lxpanelctl restart` exists, but it breaks often leaving us without any panel 1.7 - killall lxpanel; DISPLAY=':0.0' lxpanel & 1.8 + lxpanel_pid="$(ps -o comm,pid | fgrep lxpanel | awk '{print $2}')" 1.9 + lxpanel_user="$(ps -o comm,user | fgrep lxpanel | awk '{print $2}')" 1.10 + lxpanel_comm="$(ps -o pid,args | grep -e "^\ *$lxpanel_pid " | awk '{$1="";print}')" 1.11 + 1.12 + if [ "$USER" == "$lxpanel_user" ]; then 1.13 + kill $lxpanel_pid 1.14 + DISPLAY=':0.0' XAUTHORITY='/var/run/slim.auth' $lxpanel_comm 1>/tmp/debug1 2>/tmp/debug2 & 1.15 + fi 1.16 } 1.17 1.18 1.19 @@ -122,6 +129,7 @@ 1.20 if [ ! -e "$lxpanel" ]; then 1.21 mkdir -p "$lxpanel"; cp /etc/lxpanel/default /etc/lxpanel/slitaz $lxpanel 1.22 fi 1.23 + 1.24 for panel in $(find $lxpanel -type f -iname panel); do 1.25 awk -vicon="/usr/share/pixmaps/$(GET tweak).png" ' 1.26 BEGIN{ found = "0"; }