aboutsummaryrefslogtreecommitdiffstats
path: root/menu/xdg_menu
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-07-07 10:06:25 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-07-07 10:06:25 +0000
commitb5341f19053e44839ebf72f9dc7eb45ca73814d2 (patch)
treeb1bdc90b27fe8db2e225214e73ad17021af4ed88 /menu/xdg_menu
parent3414430334b8764c286f8373750179dfd0f48623 (diff)
downloadcommon-data-b5341f19053e44839ebf72f9dc7eb45ca73814d2.tar
common-data-b5341f19053e44839ebf72f9dc7eb45ca73814d2.tar.gz
common-data-b5341f19053e44839ebf72f9dc7eb45ca73814d2.tar.bz2
common-data-b5341f19053e44839ebf72f9dc7eb45ca73814d2.tar.xz
common-data-b5341f19053e44839ebf72f9dc7eb45ca73814d2.zip
fix generating icewm menu
Diffstat (limited to 'menu/xdg_menu')
-rwxr-xr-xmenu/xdg_menu10
1 files changed, 8 insertions, 2 deletions
diff --git a/menu/xdg_menu b/menu/xdg_menu
index b39575b..099d41f 100755
--- a/menu/xdg_menu
+++ b/menu/xdg_menu
@@ -56,6 +56,12 @@ sub check_file ($)
}
}
+sub add_png_extension_if_needed ($)
+{
+ my ($f) = @_;
+ return $f =~ /\.(png|xpm|svg)$/ ? $f : "$f.png";
+}
+
sub scan_AppDir ($$;$)
{
my ($pool, $dir, $topdir) = @_;
@@ -1569,7 +1575,7 @@ sub output_icewm_menu ($;$)
my $menu_icon = $menu->{'PrepIcon'} || "folder" ;
$output .= ' ' x $indent;
- $output .= "menu \"$menu_name\" $menu_icon {\n";
+ $output .= "menu \"$menu_name\" $menu_icon.png {\n";
foreach my $entry (@{$menu->{'entries'}}) {
if ($entry->{type} eq 'desktop') {
@@ -1577,7 +1583,7 @@ sub output_icewm_menu ($;$)
my $name = $desktop->{'PrepName'};
my $exec = $desktop->{'PrepExec'};
- my $icon = $desktop->{'Icon'};
+ my $icon = add_png_extension_if_needed($desktop->{'Icon'});
$output .= ' ' x $indent;
$output .= " prog \"$name\" $icon $exec\n";