vfmg: VFMG/xpde_out.pm (NEW) - xpde backend
sparky
sparky at pld-linux.org
Sat Dec 2 00:52:48 CET 2006
Author: sparky Date: Fri Dec 1 23:52:48 2006 GMT
Module: vfmg Tag: HEAD
---- Log message:
- xpde backend
---- Files affected:
vfmg/VFMG:
xpde_out.pm (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: vfmg/VFMG/xpde_out.pm
diff -u /dev/null vfmg/VFMG/xpde_out.pm:1.1
--- /dev/null Sat Dec 2 00:52:48 2006
+++ vfmg/VFMG/xpde_out.pm Sat Dec 2 00:52:43 2006
@@ -0,0 +1,38 @@
+package VFMG::Output;
+
+use strict;
+use warnings;
+use File::Path qw(mkpath);
+
+sub destdir {
+ return "$ENV{'HOME'}/.xpde/Start Menu/Programs";
+}
+
+sub xpde {
+ 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};
+ open F_OUT, ">> $dir/$$d{file}.lnk" or warn "$dir/$$d{file}.lnk: $!\n";
+ print F_OUT "[Shortcut]\n",
+ "Caption=$name\n",
+ "Command=$$d{Exec}\n";
+ print F_OUT "Icon=$icon\n" if length $icon;
+ close F_OUT;
+ } else {
+ $name =~ s#/##g;
+ mkpath("$dir/$name",0,0700);
+ xpde($main::menu[$no]{$entry}, "$dir/$name");
+ }
+ }
+}
+
+sub do_menu() {
+ xpde($main::opt{strip}, $main::opt{destdir});
+}
+
+1;
================================================================
More information about the pld-cvs-commit
mailing list