vfmg (DEVEL): vfmg, vfmgrc - icons_ext renamed to icons_oext - rea...

sparky sparky at pld-linux.org
Sun Dec 11 03:38:29 CET 2005


Author: sparky                       Date: Sun Dec 11 02:38:29 2005 GMT
Module: vfmg                          Tag: DEVEL
---- Log message:
- icons_ext renamed to icons_oext
- readded option similar to checking for icon existance in HEAD version:
  icon file name extension is added if missing

---- Files affected:
vfmg:
   vfmg (1.73.2.43 -> 1.73.2.44) , vfmgrc (1.9 -> 1.10) 

---- Diffs:

================================================================
Index: vfmg/vfmg
diff -u vfmg/vfmg:1.73.2.43 vfmg/vfmg:1.73.2.44
--- vfmg/vfmg:1.73.2.43	Thu Dec  8 03:00:57 2005
+++ vfmg/vfmg	Sun Dec 11 03:38:24 2005
@@ -16,11 +16,12 @@
 	exec		=> 0,
 	exec_full	=> 0,
 	icons		=> 1,
+	icons_ext	=> 0,
 	icons_full	=> 0,
 	icons_scale	=> 0,
 	icons_fork	=> 0,
 	icons_dir	=> "",
-	icons_ext	=> "png",
+	icons_oext	=> "png",
 	
 	utf			=> 0,
 	encoding	=> "",
@@ -67,13 +68,15 @@
 	'exec-full|full-exec|X!'
 					=>	\$opt{exec_full},
 	'icons|i!'		=>	\$opt{icons},
+	'icons-ext|T!'	=>	\$opt{icons_ext},
 	'icons-full|full-icons|I!'	
 					=>	\$opt{icons_full},
 	'icons-scale|scale-icons|S!'
 					=>	\$opt{icons_scale},
 	'icons-fork!'	=>	\$opt{icons_fork},
 	'icons-dir|d=s'	=>	\$opt{icons_dir},
-	'icons-ext|T=s'	=>	\$opt{icons_ext},
+	'icons-oext|O=s'
+					=>	\$opt{icons_oext},
 	'text-icon=s'	=>	\$opt{text_icon},
 	
 	'wcnt-file=s'	=>	\$opt{wcnt_file},
@@ -90,8 +93,8 @@
 	'promote|p!'	=>	\$opt{promote},
 	'strip|s!'		=>	\$opt{strip},
 	'nomenu|m!'		=>	\$opt{nomenu},
-	'only-in|o=s'
-					=>	\$opt{only_in},
+	'only-in|o=s'	=>	\$opt{only_in},
+	
 	'xterm|r=s'		=>	\$opt{xterm},
 	'convert|C=s'	=>	\$opt{convert},
 	'full-regen|f!'	=>	\$opt{full_regen},
@@ -115,11 +118,13 @@
     -x, --exec        - check for binaries existence
     -X, --exec-full   - extend binaries to full path (implies -x)
     -i, --icons       - add icons to menu (default: yes)
+    -T, --icons-ext   - check for icons existence and add extension if required
     -I, --icons-full  - check for icons existence and extend to full path
+
     -S, --icons-scale - scale (shrink) icons (implies -i -I)
         --icons-fork  - scale icons after fork
     -d, --icons-dir=  - output dir for icons
-    -T, --icons-ext=  - output icons extension (default: png)
+    -O, --icons-oext= - output icons extension (default: png)
 
   Output encoding:
     -u, --utf8        - output in utf8 (default is locale setting)
@@ -212,6 +217,7 @@
 		warn "Icons destination directory is not specified, not scaling.\n";
 	}
 }
+$opt{icons_ext} = 1 if $opt{icons_full};
 $opt{encoding}="utf8" if $opt{utf};
 if ( grep { $o_output eq $_ } keys %destdir ) {
 	$opt{destdir} = $destdir{$o_output} unless (length $opt{destdir});
@@ -383,7 +389,7 @@
 		s/%2/$tags{Exec}/;
 		$tags{Exec} = $_;
 	}
-	if ( $opt{icons_full} ) {
+	if ( $opt{icons_ext} ) {
 		my $exists=0;
 		my @idirs;
 		push @idirs, '' if $tags{Icon} =~ m|^/|;
@@ -391,7 +397,8 @@
 		foreach my $dir (@idirs) {
 			foreach my $ext ('', qw(.svg .xpm .png)) {
 				if (-f $dir . $tags{Icon} . $ext) {
-					$tags{Icon} = $dir . $tags{Icon} .$ext;
+					$tags{Icon} .= $ext;
+					$tags{Icon} = $dir . $tags{Icon} if $opt{icons_full};
 					$exists=1;
 					last;
 				}
@@ -721,13 +728,14 @@
 				last;
 			}
 			if ($ok) {
-				if($opt{icons_full}) {
+				if($opt{icons_ext}) {
 					my $exists=0;
 					foreach my $dir (@icondirs) {
 						foreach my $ext ('', qw(.svg .xpm .png)) {
 							if (-f $dir . $icon . $ext) {
-								$exists=1;
-								$icon = $dir . $icon . $ext;
+								$icon .= $ext;
+								$icon = $dir . $icon if $opt{icons_full};
+								$exists = 1;
 								last;
 							}
 						}
@@ -855,7 +863,7 @@
 	
 	(my $icon_out = $icon_in ) =~ s/^.*\///;
 	$icon_out =~ s/\..*$//;
-	$icon_out = "$opt{icons_dir}/$icon_out.$opt{icons_ext}";
+	$icon_out = "$opt{icons_dir}/$icon_out.$opt{icons_oext}";
 	
 	unless (-f $icon_out) {
 		$_ = $opt{convert};
@@ -1402,7 +1410,7 @@
 	$DR{tmp} = $ENV{'TMPDIR'};
 	$DR{tmp} = $ENV{'TMP'}  unless -d $DR{tmp};
 	$DR{tmp} = "/tmp"  unless -d $DR{tmp};
-	$DR{icon} = $DR{tmp}."/icon.".$opt{icons_ext};
+	$DR{icon} = $DR{tmp}."/icon.".$opt{icons_oext};
 	
 	$opt{convert} =~ s/\%out/$DR{icon}/g;
 	chdir($DR{tmp});
@@ -1420,7 +1428,7 @@
 	open F_OUT, "> icon.edc"; # {{{
 	print F_OUT << "EOF";
 	images {
-		image: "icon.$opt{icons_ext}" COMP;
+		image: "icon.$opt{icons_oext}" COMP;
 	}
 	collections {
 		group {
@@ -1433,7 +1441,7 @@
 					description {
 						state: "default" 0.0;
 						aspect: 1.0 1.0;
-						image.normal: "icon.$opt{icons_ext}";
+						image.normal: "icon.$opt{icons_oext}";
 					}
 				}
 			}

================================================================
Index: vfmg/vfmgrc
diff -u vfmg/vfmgrc:1.9 vfmg/vfmgrc:1.10
--- vfmg/vfmgrc:1.9	Wed Dec  7 17:50:45 2005
+++ vfmg/vfmgrc	Sun Dec 11 03:38:24 2005
@@ -5,11 +5,12 @@
 #exec	= 0/1
 #exec_full	= 0/1
 #icons	= 0/1
+#icons_ext	= 0/1
 #icons_full	= 0/1
 #icons_scale	= 0/1
 #icons_fork	= 0/1
 #icons_dir	= string
-#icons_ext	= string
+#icons_oext	= string
 #utf	= 0/1
 #encoding	= string
 #clear	= 0/1
@@ -44,7 +45,7 @@
 #exec_full	= 1
 
 icons	= 1
-icons_ext	= png
+icons_oext	= png
 
 # "faster" menu generation if icons are scaled, but some WMs checks
 # only once for icons existance
@@ -79,7 +80,7 @@
 # realy it can scale icons, but we nead to unify them
 icons_scale	= 1
 # DR17 uses png for everything
-icons_ext	= png
+icons_oext	= png
 # conflicts with icons_fork
 icons_fork	= 0
 # icons may be large, as DR17 can scale them
@@ -184,7 +185,7 @@
 # requires directory for icons (no standart dir)
 icons_dir	= ${HOME}/.icons/qvwm
 # qvwm uses xpm, but png works too
-icons_ext	= xpm
+icons_oext	= xpm
 # geometry like in *.xpm icons
 convert	= convert -geometry 16x16 %in %out
 #should be unstripped
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/vfmg/vfmg?r1=1.73.2.43&r2=1.73.2.44&f=u
    http://cvs.pld-linux.org/vfmg/vfmgrc?r1=1.9&r2=1.10&f=u




More information about the pld-cvs-commit mailing list