From b5341f19053e44839ebf72f9dc7eb45ca73814d2 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 7 Jul 2006 10:06:25 +0000 Subject: fix generating icewm menu --- menu/xdg_menu | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'menu') 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"; -- cgit v1.2.1