tazpanel diff settings.cgi @ rev 479
header.html/submenus: detect icon
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun May 03 13:23:31 2015 +0200 (2015-05-03) |
parents | 84d34ba7dc06 |
children | df54c758feb8 |
line diff
1.1 --- a/settings.cgi Fri May 01 19:30:01 2015 +0300 1.2 +++ b/settings.cgi Sun May 03 13:23:31 2015 +0200 1.3 @@ -28,7 +28,10 @@ 1.4 done 1.5 } 1.6 1.7 - 1.8 +restart_lxpanel() { 1.9 + # `lxpanelctl restart` exists, but it breaks often leaving us without any panel 1.10 + killall lxpanel; DISPLAY=':0.0' lxpanel & 1.11 +} 1.12 1.13 1.14 1.15 @@ -100,6 +103,8 @@ 1.16 HOME="$(awk -F: -vu=$REMOTE_USER '$1==u{print $6}' /etc/passwd)" 1.17 [ -z "$HOME" ] && exit 0 1.18 1.19 + dd="$HOME/.local/share/desktop-directories"; sd="$dd/SliTazMenu.directory" 1.20 + 1.21 case $REMOTE_USER in 1.22 root) color=31; ind='#';; 1.23 *) color=32; ind='$';; 1.24 @@ -117,7 +122,7 @@ 1.25 if [ ! -e "$lxpanel" ]; then 1.26 mkdir -p "$lxpanel"; cp /etc/lxpanel/default /etc/lxpanel/slitaz $lxpanel 1.27 fi 1.28 - for panel in $(find /home/tux/.config/lxpanel -type f -iname panel); do 1.29 + for panel in $(find $lxpanel -type f -iname panel); do 1.30 awk -vicon="/usr/share/pixmaps/$(GET tweak).png" ' 1.31 BEGIN{ found = "0"; } 1.32 { 1.33 @@ -140,20 +145,14 @@ 1.34 mv -f $panel.new $panel 1.35 done 1.36 1.37 - # `lxpanelctl restart` exists, but it breaks often leaving us without any panel 1.38 - killall lxpanel; DISPLAY=':0.0' lxpanel & 1.39 - ;; 1.40 + restart_lxpanel;; 1.41 menu-notext) 1.42 - dd="$HOME/.local/share/desktop-directories" 1.43 mkdir -p $dd 1.44 - echo -e '[Desktop Entry]\nType=Directory\nName=' > $dd/SliTazMenu.directory 1.45 - killall lxpanel; DISPLAY=':0.0' lxpanel & 1.46 - ;; 1.47 + echo -e '[Desktop Entry]\nType=Directory\nName=' > $sd 1.48 + restart_lxpanel;; 1.49 menu-text) 1.50 - dd="$HOME/.local/share/desktop-directories/SliTazMenu.directory" 1.51 - [ -f "$dd" ] && rm "$dd" 1.52 - killall lxpanel; DISPLAY=':0.0' lxpanel & 1.53 - ;; 1.54 + [ -f "$sd" ] && rm "$sd" 1.55 + restart_lxpanel;; 1.56 esac 1.57 exit 0 1.58 ;;