tazpanel rev 476

settings.cgi: fix typo, tiny edits.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat May 02 05:20:54 2015 +0300 (2015-05-02)
parents de34ca9d1417
children a15936aa1275
files settings.cgi
line diff
     1.1 --- a/settings.cgi	Fri May 01 23:56:00 2015 +0200
     1.2 +++ b/settings.cgi	Sat May 02 05:20:54 2015 +0300
     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  		;;