# HG changeset patch # User Aleksej Bobylev # Date 1430533254 -10800 # Node ID 58e332bcef0b5a0d1a629f79a453b9dbf54801f2 # Parent de34ca9d1417fe9af7af1c351c61b8a92673ce20 settings.cgi: fix typo, tiny edits. diff -r de34ca9d1417 -r 58e332bcef0b settings.cgi --- a/settings.cgi Fri May 01 23:56:00 2015 +0200 +++ b/settings.cgi Sat May 02 05:20:54 2015 +0300 @@ -28,7 +28,10 @@ done } - +restart_lxpanel() { + # `lxpanelctl restart` exists, but it breaks often leaving us without any panel + killall lxpanel; DISPLAY=':0.0' lxpanel & +} @@ -100,6 +103,8 @@ HOME="$(awk -F: -vu=$REMOTE_USER '$1==u{print $6}' /etc/passwd)" [ -z "$HOME" ] && exit 0 + dd="$HOME/.local/share/desktop-directories"; sd="$dd/SliTazMenu.directory" + case $REMOTE_USER in root) color=31; ind='#';; *) color=32; ind='$';; @@ -117,7 +122,7 @@ if [ ! -e "$lxpanel" ]; then mkdir -p "$lxpanel"; cp /etc/lxpanel/default /etc/lxpanel/slitaz $lxpanel fi - for panel in $(find /home/tux/.config/lxpanel -type f -iname panel); do + for panel in $(find $lxpanel -type f -iname panel); do awk -vicon="/usr/share/pixmaps/$(GET tweak).png" ' BEGIN{ found = "0"; } { @@ -140,20 +145,14 @@ mv -f $panel.new $panel done - # `lxpanelctl restart` exists, but it breaks often leaving us without any panel - killall lxpanel; DISPLAY=':0.0' lxpanel & - ;; + restart_lxpanel;; menu-notext) - dd="$HOME/.local/share/desktop-directories" mkdir -p $dd - echo -e '[Desktop Entry]\nType=Directory\nName=' > $dd/SliTazMenu.directory - killall lxpanel; DISPLAY=':0.0' lxpanel & - ;; + echo -e '[Desktop Entry]\nType=Directory\nName=' > $sd + restart_lxpanel;; menu-text) - dd="$HOME/.local/share/desktop-directories/SliTazMenu.directory" - [ -f "$dd" ] && rm "$dd" - killall lxpanel; DISPLAY=':0.0' lxpanel & - ;; + [ -f "$sd" ] && rm "$sd" + restart_lxpanel;; esac exit 0 ;;