vfmg: VFMG/afterstep_out.pm (NEW) - afterstep backend

sparky sparky at pld-linux.org
Sat Dec 2 00:57:28 CET 2006


Author: sparky                       Date: Fri Dec  1 23:57:28 2006 GMT
Module: vfmg                          Tag: HEAD
---- Log message:
- afterstep backend

---- Files affected:
vfmg/VFMG:
   afterstep_out.pm (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: vfmg/VFMG/afterstep_out.pm
diff -u /dev/null vfmg/VFMG/afterstep_out.pm:1.1
--- /dev/null	Sat Dec  2 00:57:28 2006
+++ vfmg/VFMG/afterstep_out.pm	Sat Dec  2 00:57:23 2006
@@ -0,0 +1,38 @@
+package VFMG::Output;
+
+use strict;
+use warnings;
+use File::Path qw(mkpath);
+
+sub destdir {
+	return "$ENV{'HOME'}/GNUstep/Library/AfterStep/start";
+}
+
+sub afterstep {
+	my ($no, $dir) = @_;
+	
+	foreach my $entry (keys %{$main::menu[$no]}) {
+		my $d = $main::desktop[$entry];
+		my $name = main::encode($main::opt{encoding},$$d{Name});
+		if ($main::menu[$no]{$entry} < 0) {
+			$name=~s/\"/\\\"/g;
+			my $icon = "";
+			$icon = main::scale_icon($$d{Icon}) if $main::opt{icons};
+			my $F_OUT;
+			open $F_OUT, ">> $dir/$$d{file}" or warn "$dir/$$d{file}: $!\n";
+			print $F_OUT qq(Exec "$name" exec $$d{Exec}\n);
+			print $F_OUT qq(MiniPixmap "$icon"\n) if length $icon;
+			close $F_OUT;
+		} else {
+			$name =~ s#/##g;
+			mkpath("$dir/$name",0,0700);
+			afterstep($main::menu[$no]{$entry},"$dir/$name");
+		}
+	}
+}
+
+sub do_menu() {
+	afterstep($main::opt{strip},$main::opt{destdir});
+}
+
+1;
================================================================


More information about the pld-cvs-commit mailing list