diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-07-07 10:06:25 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-07-07 10:06:25 +0000 |
commit | b5341f19053e44839ebf72f9dc7eb45ca73814d2 (patch) | |
tree | b1bdc90b27fe8db2e225214e73ad17021af4ed88 | |
parent | 3414430334b8764c286f8373750179dfd0f48623 (diff) | |
download | common-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
-rwxr-xr-x | menu/xdg_menu | 10 |
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"; |