Enlightenment CVS committal

Author  : mej
Project : eterm
Module  : Eterm

Dir     : eterm/Eterm/utils


Modified Files:
      Tag: ETERM-0_10
        Etbg_update_list 


Log Message:
Sun Aug 24 11:15:56 2003                        Michael Jennings (mej)

--> Merge <--

===================================================================
RCS file: /cvsroot/enlightenment/eterm/Eterm/utils/Etbg_update_list,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -3 -r1.3 -r1.3.2.1
--- Etbg_update_list    22 Sep 2001 16:42:18 -0000      1.3
+++ Etbg_update_list    24 Aug 2003 15:16:45 -0000      1.3.2.1
@@ -2,11 +2,21 @@
 #
 # Eterm backgrounds list file update utility
 #
-# $Id: Etbg_update_list,v 1.3 2001/09/22 16:42:18 mej Exp $
+# $Id: Etbg_update_list,v 1.3.2.1 2003/08/24 15:16:45 mej Exp $
 
 LISTFILE=pixmaps.list
 
-if [ $# -gt 1 -o "X$1" = "X-h" -o "X$1" = "X--help" ]; then
+if [ "x$1" = "x-m" ]; then
+    shift
+    ETBG_MENUFILE="$1"
+    export ETBG_MENUFILE
+    shift
+    exec 3> "$ETBG_MENUFILE"
+else
+    exec 3>/dev/null
+fi
+
+if [ "x$1" = "x-h" -o "x$1" = "x--help" ]; then
   echo "Syntax:  Etbg_update_list [path]"
   echo "   (The default path is the current directory.)"
   echo
@@ -23,21 +33,45 @@
 
 cd $PIXDIR
 
+# Make sure sed works; if not, use perl
+SEDCMD="sed -e 's/[-_]/ /g' -e 's/^\(.\)/\u\1/' -e 's/ \(.\)/ \u\1/g' -e 's/\....$//'"
+if [ "x`echo i | sed -e 's/^\(.\)/\u\1/'`" != "xI" ]; then
+    SEDCMD='perl -p -e "s/[-_]/ /g; s/^(.)/\u\1/; s/ (.)/ \u\1/g; s/\....$//;"'
+fi
+
 # Generate new pixmap list from tile/ and scale/ directories
 echo "Etbg_update_list:  Generating pixmap list file from images in tile/ and 
scale/..."
 true > $LISTFILE.new
 
+cat >&3 <<EOF
+begin menu
+  title Tiled
+EOF
 if [ -d tile ]; then
   for i in `(cd tile && ls -1)` ; do 
     echo '"tile/'$i'@0x0+0+0:tile"' >> $LISTFILE.new
+    echo "  begin menuitem" >&3
+    eval echo "\ \ \ \ text \\\"\`echo $i | $SEDCMD\`\\\"" >&3
+    echo "    action string \"\\e]20;tile/$i;0x0+0+0:tile\\a\"" >&3
+    echo "  end" >&3
   done
 fi
+cat >&3 <<EOF
+end
+begin menu
+  title Scaled
+EOF
 
 if [ -d scale ]; then
   for i in `(cd scale && ls -1)` ; do \
     echo '"scale/'$i'@100x100"' >> $LISTFILE.new ; \
+    echo "  begin menuitem" >&3
+    eval echo "\ \ \ \ text \\\"\`echo $i | $SEDCMD\`\\\"" >&3
+    echo "    action string \"\\e]20;tile/$i;0x0+0+0:tile\\a\"" >&3
+    echo "  end" >&3
   done
 fi
+echo "end" >&3
 
 # Check to see if the list has changed.  If so, back up the old one.
 if [ -s $LISTFILE ]; then




-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to