vfmg (DEVEL): vfmg - advanced DR17 menu generation, some things ha...
sparky
sparky at pld-linux.org
Sat Dec 3 00:37:42 CET 2005
Author: sparky Date: Fri Dec 2 23:37:42 2005 GMT
Module: vfmg Tag: DEVEL
---- Log message:
- advanced DR17 menu generation, some things hardcoded but will be configurable
soon, efect is realy cool, DR17 puts icon in window tittle bar, see it at:
http://mural.uv.es/~pris/vfmg-generated_DR17menu.png
---- Files affected:
vfmg:
vfmg (1.73.2.40 -> 1.73.2.41)
---- Diffs:
================================================================
Index: vfmg/vfmg
diff -u vfmg/vfmg:1.73.2.40 vfmg/vfmg:1.73.2.41
--- vfmg/vfmg:1.73.2.40 Fri Dec 2 13:53:09 2005
+++ vfmg/vfmg Sat Dec 3 00:37:36 2005
@@ -39,8 +39,9 @@
my $o_output;
$defopt{xterm}="$ENV{'VFMG_TERM'}" if $ENV{'VFMG_TERM'};
-my @wms = qw(ASCII DR17 aewm afterstep blackbox enlightenment fbpanel fluxbox
- fvwm fvwm2 icewm metisse olvwm openbox qvwm wmaker wmaker-old xfce4 xpde);
+my @wms = qw(ASCII DR17 DR17-advanced aewm afterstep blackbox enlightenment
+ fbpanel fluxbox fvwm fvwm2 icewm metisse olvwm openbox qvwm wmaker
+ wmaker-old xfce4 xpde);
# %destdir and %iconsdir should only contain directories propsed by WM
my %destdir = (
@@ -147,6 +148,7 @@
$o_output=$ARGV[0];
die "Unrecognized argument: $o_output\n"
unless grep { $o_output eq $_ } @wms;
+$o_output =~ s/-advanced//;
# vfmgrc {{{
my @rcFiles = (qw(/etc/vfmgrc), "$ENV{'HOME'}/.vfmgrc");
@@ -452,7 +454,7 @@
$tags{Exec} =~ s/%%/%/g;
$file =~ s/\.desktop$//;
- push @desktop, [$file, $utfname, $tags{Icon}, $tags{Exec}, $genname];
+ push @desktop, [$file, $utfname, $tags{Icon}, $tags{Exec}, $genname, $tags{term}, $bin];
$apps[$#desktop]{$_} = 1 # two apps can have same names now:)
foreach grep length, split /;+/, $tags{Categories};
@@ -849,6 +851,8 @@
use constant ICON => 2;
use constant EXEC => 3;
use constant GENNAME => 4;
+use constant TERM => 5;
+use constant BIN => 6;
use constant step => "\t";
@@ -904,40 +908,61 @@
foreach my $entry (sort cmpdname keys %{$menu[$no]}) {
my $d = $desktop[$entry];
my $name = $$d[LOCALENAME];
- print $tab.$name."..";
+ print $tab.$name.".." if $o_verbose;
unlink $$dr{icon};
my $icon = $$d[ICON];
- $icon = $$dr{tmp}."/blank.xpm" unless -r $icon;
- scale_icon($icon);
+ if ( exists $$dr{advanced} && not -r $icon ) {
+ ( my $exe = $$dr{text_icon} ) =~ s/%1/"$name"/;
+ system($exe);
+ } else {
+ $icon = $$dr{tmp}."/blank.xpm" unless -r $icon;
+ scale_icon($icon);
+ }
die "No icon $$dr{icon}\n" unless -r $$dr{icon};
- print "..";
+ print ".." if $o_verbose;
if($menu[$no]{$entry} < 0) {
my $file = "$opt{icons_dir}/$$d[FILENAME].eap";
system(@edje,$file);
- print "..";
+ print ".." if $o_verbose;
my @eapp = qw(enlightenment_eapp);
push @eapp, $file;
push @eapp, "-set-name",$name;
push @eapp, "-set-generic",$$d[GENNAME] if length $$d[GENNAME];
push @eapp, "-set-exe",$$d[EXEC];
-
+ if ( exists $$dr{advanced} ) {
+ if ( exists $$dr{wcnt}{$$d[FILENAME]} ) {
+ my $wcnt = $$dr{wcnt}{$$d[FILENAME]};
+ push @eapp, "-set-win-class", $$wcnt[0] if defined $$wcnt[0];
+ push @eapp, "-set-win-name", $$wcnt[1] if defined $$wcnt[1];
+ push @eapp, "-set-win-title", $$wcnt[2] if defined $$wcnt[2];
+ } else {
+ if ( $$d[TERM] == 1 ) {
+ push @eapp, "-set-win-name", "Eterm-".$$d[BIN];
+ } else {
+ my $exe = (split /\s/, $$d[EXEC])[0];
+ $exe = ucfirst lc $exe;
+ push @eapp, "-set-win-class", $exe;
+ }
+ }
+ }
system(@eapp);
- print "..DONE\n";
+
+ print "..DONE\n" if $o_verbose;
$apps .= $$d[FILENAME] . ".eap\n";
} else {
my $subdir = sprintf "%s/%s", $dir, $$d[FILENAME];
my $file = $subdir . "/.directory.eap";
mkpath($subdir,0,0700);
- print "..";
+ print ".." if $o_verbose;
system(@edje, $file);
- print "..";
+ print ".." if $o_verbose;
system("enlightenment_eapp",$file,
"-set-name",$name);
- print "..DONE\n";
+ print "..DONE\n" if $o_verbose;
DR17($menu[$no]{$entry},$subdir,$tab.step,$dr);
$dirs .= $$d[FILENAME]."\n";
}
@@ -1380,6 +1405,26 @@
}
EOF
close F_OUT; # }}}
+ if ( $ARGV[0] eq "DR17-advanced" ) { # {{{
+ warn "DR17-advanced !!!\n";
+ open F_IN, "$ENV{HOME}/WIN_cnt" or die;
+ $DR{wcnt} = {};
+ while ( <F_IN> ) {
+ next if /^\s*#/;
+ next unless s/^\s*(\S+)//;
+ my $name = $1;
+ $DR{wcnt}{$name} = [undef, undef, undef];
+ foreach my $num (0..2) {
+ next unless s/^\s*"(([^"]|\")*?[^\\])"// or s/^\s*(\S+)//;
+ $DR{wcnt}{$name}[$num] = $1 unless $1 eq "*";
+ }
+ }
+ close F_IN;
+ $DR{text_icon} = "convert -scale 64x64 -annotate 0,0,2,38 %1" .
+ " -font /usr/share/fonts/TTF/VeraBd.ttf -pointsize 24" .
+ " $DR{tmp}/blank.xpm $DR{icon}";
+ $DR{advanced} = 1;
+ } # }}}
DR17($opt{strip},$opt{destdir},"",\%DR);
unlink "blank.xpm";
unlink "icon.edc";
================================================================
---- CVS-web:
http://cvs.pld-linux.org/vfmg/vfmg?r1=1.73.2.40&r2=1.73.2.41&f=u
More information about the pld-cvs-commit
mailing list