From 7e2c8076979f2d1d294963aad7fd733c500f6089e0cb01c004cf5f392c614951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Sat, 4 May 2024 02:03:00 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main xdg-menu revision 5b51617c623fbbd4cce56ea2a721a2ee --- .gitattributes | 23 ++ xdg-menu-accept-defaultlayout-bnc529057.patch | 14 ++ xdg-menu-box.patch | 229 ++++++++++++++++++ xdg-menu-gnome-path.patch | 10 + xdg-menu-icewm.patch | 20 ++ xdg-menu-pekwm.patch | 69 ++++++ xdg-menu-su.patch | 9 + xdg-menu-translation-bnc463972.patch | 60 +++++ xdg-menu-twm.patch | 77 ++++++ xdg-menu-xfce4-icon.patch | 52 ++++ xdg-menu-xfce4.patch | 108 +++++++++ xdg-menu.changes | 157 ++++++++++++ xdg-menu.spec | 76 ++++++ xdg-menu.tar.bz2 | 3 + 14 files changed, 907 insertions(+) create mode 100644 .gitattributes create mode 100644 xdg-menu-accept-defaultlayout-bnc529057.patch create mode 100644 xdg-menu-box.patch create mode 100644 xdg-menu-gnome-path.patch create mode 100644 xdg-menu-icewm.patch create mode 100644 xdg-menu-pekwm.patch create mode 100644 xdg-menu-su.patch create mode 100644 xdg-menu-translation-bnc463972.patch create mode 100644 xdg-menu-twm.patch create mode 100644 xdg-menu-xfce4-icon.patch create mode 100644 xdg-menu-xfce4.patch create mode 100644 xdg-menu.changes create mode 100644 xdg-menu.spec create mode 100644 xdg-menu.tar.bz2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/xdg-menu-accept-defaultlayout-bnc529057.patch b/xdg-menu-accept-defaultlayout-bnc529057.patch new file mode 100644 index 0000000..af4df32 --- /dev/null +++ b/xdg-menu-accept-defaultlayout-bnc529057.patch @@ -0,0 +1,14 @@ +--- xdg_menu ++++ xdg_menu +@@ -638,6 +638,11 @@ + interpret_Exclude($tree->[$i], $menu{'entries'}, $pool); + $i++; + } ++ elsif ($tree->[$i] eq 'DefaultLayout') { ++ #FIXME: use the values ++ $i++; ++ $i++; ++ } + elsif ($tree->[$i] eq '0') { + $i++; + if ($tree->[$i] !~ /^\s*$/) { diff --git a/xdg-menu-box.patch b/xdg-menu-box.patch new file mode 100644 index 0000000..9968f8b --- /dev/null +++ b/xdg-menu-box.patch @@ -0,0 +1,229 @@ +diff -ur xdg-menu.orig/xdg_menu xdg-menu/xdg_menu +--- xdg-menu.orig/xdg_menu 2004-11-30 13:23:12.459157549 +0100 ++++ xdg-menu/xdg_menu 2004-11-30 13:28:27.640045633 +0100 +@@ -26,6 +26,7 @@ + + my $die_on_error = 0; + my $verbose = 0; ++my $fullmenu = 0; + + my @language_keys; + +@@ -1410,6 +1411,40 @@ + + sub output_blackbox_menu ($;$) + { ++ my ($menu, $indent) = @_; ++ ++ my $output = ''; ++ ++ $output .= "[begin] (Menu)\n"; ++ $output .= "[exec] (xterm) {xterm}\n[separator]\n"; ++ $output .= output_blackbox_inner_menu ($menu, $indent); ++ $output .= "[separator]\n"; ++ $output .= '[config] (Configuration) ++ [workspaces] (Workspace) ++ [submenu] (System Styles) {Choose a style...} ++ [stylesdir] (/usr/share/blackbox/styles) ++ [stylesdir] (/usr/share/fluxbox/styles) ++ [stylesdir] (/usr/share/openbox/styles) ++ [end] ++ [submenu] (User Styles) {Choose a style...} ++ [stylesdir] (~/.blackbox/styles) ++ [stylesdir] (~/.fluxbox/styles) ++ [stylesdir] (~/.openbox/styles) ++ [end] ++ [separator] ++ [exec] (Run Command) {bbrun -a -w} ++ [exec] (Lock Screen) {xlock} ++ [restart] (Restart) {} ++ [exit] (Logout) ++[end] ++'; ++ $output .= "[end]\n"; ++ return $output; ++} ++ ++ ++sub output_blackbox_inner_menu ($;$) ++{ + my ($menu, $indent) = @_; + + my $output = ''; +@@ -1432,7 +1467,7 @@ + $output .= " [exec] ($name) {$exec}\n"; + } + elsif ($entry->{type} eq 'menu') { +- $output .= output_blackbox_menu ($entry->{'menu'}, $indent + 1); ++ $output .= output_blackbox_inner_menu ($entry->{'menu'}, $indent + 1); + } + else { + print STDERR "wrong menu entry type: $entry->{type}"; +@@ -1570,6 +1605,94 @@ + return $output; + } + ++sub output_openbox3_menu ($;$) ++{ ++ my ($menu, $indent) = @_; ++ ++ my $output = ''; ++ ++ $output .= ' ++ ++'; ++ $output .= "\n"; ++ $output .= output_openbox3_inner_menu ($menu, $indent); ++ $output .= "\n"; ++ $output .= ' ++ ++ xterm ++ ++ ++ ++ ++ ++ ++ obconf ++ ++ ++ ++ xlock -remote -nice 19 -mode blank -geometry 1x1 -enablesaver ++ ++ ++ '; ++ $output .= "\n"; ++ return $output; ++} ++ ++sub output_openbox3_pipe_menu ($;$) ++{ ++ my ($menu, $indent) = @_; ++ ++ my $output = ''; ++ ++ $output .= "\n"; ++ $output .= output_openbox3_inner_menu ($menu, $indent); ++ $output .= "\n"; ++ return $output; ++} ++ ++sub output_openbox3_inner_menu ($;$) ++{ ++ my ($menu, $indent) = @_; ++ ++ my $output = ''; ++ ++ $indent = 0 unless defined $indent; ++ my $menu_name = $menu->{'PrepName'}; ++ ++ $output .= ' ' x $indent; ++ $output .= "\n"; ++# $output .= "\n"; ++ ++ foreach my $entry (@{$menu->{'entries'}}) { ++ if ($entry->{type} eq 'desktop') { ++ my $desktop = $entry->{desktop}; ++ ++ my $name = $desktop->{'PrepName'}; ++ my $exec = $desktop->{'PrepExec'}; ++ ++ $output .= ' ' x $indent; ++ $output .= " \n"; ++ $output .= " $exec\n"; ++ $output .= " \n"; ++ } ++ elsif ($entry->{type} eq 'menu') { ++ $output .= output_openbox3_inner_menu ($entry->{'menu'}, $indent + 1); ++ } ++ else { ++ print STDERR "wrong menu entry type: $entry->{type}"; ++ } ++ ++ } ++ $output .= ' ' x $indent; ++ $output .= " \n"; ++ ++ return $output; ++} ++ ++ + sub output_readable ($;$) + { + my ($menu, $indent) = @_; +@@ -1862,6 +1985,7 @@ + my $help; + + GetOptions("format=s" => \$format, ++ "fullmenu" => \$fullmenu, + "desktop=s" => \$desktop_name, + "charset=s" => \$charset, + "language=s" => \$language, +@@ -1885,13 +2009,18 @@ + Usage: + xdg_menu [--format ] [--desktop ] + [--charset ] [--language ] +- [--root-menu ] [--die-on-error] [--help] ++ [--root-menu ] [--die-on-error] ++ [--fullmenu] [--help] + + format - output format +- possible formats: WindowMaker, fvwm2, blackbox, +- icewm, readable ++ possible formats: WindowMaker, fvwm2, icewm, ++ blackbox, fluxbox, openbox, ++ xfce4, openbox3, openbox3-pipe, ++ readable + default: WindowMaker +- ++ ++ fullmenu - output a full menu and not only a submenu ++ + desktop - desktop name for NotShowIn and OnlyShowIn + default: the same as format + +@@ -1942,17 +2071,35 @@ + + $output = output_fvwm2_menu($menu) + } +-elsif ($format eq 'blackbox') { +- +- $output = output_blackbox_menu($menu) +-} + elsif ($format eq 'icewm') { + +- $output = output_icewm_menu($menu) ++ $output = output_icewm_menu($menu) + } + elsif ($format eq 'xfce4') { + +- $output = output_xfce4_menu($menu) ++ $output = output_xfce4_menu($menu) ++} ++elsif ($format eq 'blackbox' || ($format eq 'openbox') || ($format eq 'fluxbox') ) { ++ if ($fullmenu) { ++ $output = output_blackbox_menu($menu) ++ } ++ else ++ { ++ $output = output_blackbox_inner_menu($menu) ++ } ++} ++elsif ($format eq 'openbox3') { ++ if ($fullmenu) { ++ $output = output_openbox3_menu($menu) ++ } ++ else ++ { ++ $output = output_openbox3_inner_menu($menu) ++ } ++} ++elsif ($format eq 'openbox3-pipe') { ++ ++ $output = output_openbox3_pipe_menu($menu) + } + elsif ($format eq 'readable') { + diff --git a/xdg-menu-gnome-path.patch b/xdg-menu-gnome-path.patch new file mode 100644 index 0000000..5a5cf0d --- /dev/null +++ b/xdg-menu-gnome-path.patch @@ -0,0 +1,10 @@ +--- xdg_menu ++++ xdg_menu +@@ -2038,6 +2038,7 @@ + $language = setlocale(LC_MESSAGES); + + $root_cmd = "/opt/gnome/bin/gnomesu" if -x '/opt/gnome/bin/gnomesu'; ++$root_cmd = "/usr/bin/gnomesu" if -x '/usr/bin/gnomesu'; + $root_cmd = "/opt/kde3/bin/kdesu" if -x '/opt/kde3/bin/kdesu'; + + my $help; diff --git a/xdg-menu-icewm.patch b/xdg-menu-icewm.patch new file mode 100644 index 0000000..d873e9a --- /dev/null +++ b/xdg-menu-icewm.patch @@ -0,0 +1,20 @@ +--- xdg_menu ++++ xdg_menu +@@ -1549,7 +1549,7 @@ + my $menu_name = $menu->{'PrepName'}; + + $output .= ' ' x $indent; +- $output .= "menu \"$menu_name\" folder {\n"; ++ $output .= "menu \"$menu_name\" folder {\n" if $indent > 0; #skip toplevel menu, bug 273232 + + foreach my $entry (@{$menu->{'entries'}}) { + if ($entry->{type} eq 'desktop') { +@@ -1570,7 +1570,7 @@ + + } + $output .= ' ' x $indent; +- $output .= "}\n"; ++ $output .= "}\n" if $indent > 0; + + return $output; + } diff --git a/xdg-menu-pekwm.patch b/xdg-menu-pekwm.patch new file mode 100644 index 0000000..9f93f27 --- /dev/null +++ b/xdg-menu-pekwm.patch @@ -0,0 +1,69 @@ +--- xdg_menu 2008-12-06 01:13:21.000000000 +0100 ++++ xdg_menu 2008-12-16 17:57:46.000000000 +0100 +@@ -1379,6 +1379,46 @@ + return $output; + } + ++sub output_pekwm_menu ($;$) ++{ ++ my ($menu, $indent) = @_; ++ ++ my $output = ''; ++ ++ $indent = 0 unless defined $indent; ++ ++ my $menu_name = $menu->{'PrepName'}; ++ ++ $output .= ' ' x $indent; ++ $output .= "Submenu = \"$menu_name\" {\n"; ++ ++ foreach my $entry (@{$menu->{'entries'}}) { ++ if ($entry->{type} eq 'desktop') { ++ my $desktop = $entry->{desktop}; ++ ++ my $name = $desktop->{'PrepName'}; ++ my $exec = $desktop->{'PrepExec'}; ++ ++ $exec =~ s/\"/\\\"/g; ++ ++ $output .= ' ' x $indent; ++ $output .= " Entry = \"$name\" { Actions = \"Exec $exec & \" }\n"; ++ } ++ elsif ($entry->{type} eq 'menu') { ++ $output .= output_pekwm_menu ($entry->{'menu'}, $indent + 1); ++ } ++ else { ++ print STDERR "wrong menu entry type: $entry->{type}"; ++ } ++ ++ } ++ $output .= ' ' x $indent; ++ $output .= "}\n"; ++ ++ return $output; ++} ++ ++ + sub output_wmaker_menu ($;$) + { + my ($menu, $indent) = @_; +@@ -2075,7 +2115,7 @@ + possible formats: WindowMaker, fvwm2, icewm, + blackbox, fluxbox, openbox, + xfce4, openbox3, openbox3-pipe, +- readable ++ pekwm, readable + default: WindowMaker + + fullmenu - output a full menu and not only a submenu +@@ -2169,6 +2209,10 @@ + + $output = output_readable($menu) + } ++elsif ($format eq 'pekwm') { ++ ++ $output = output_pekwm_menu($menu) ++} + else + { + print STDERR "Unknown format $format\n"; diff --git a/xdg-menu-su.patch b/xdg-menu-su.patch new file mode 100644 index 0000000..4c557d0 --- /dev/null +++ b/xdg-menu-su.patch @@ -0,0 +1,9 @@ +--- xdg_menu_su.orig 2003-09-17 11:23:38.000000000 +0300 ++++ xdg_menu_su 2013-02-27 21:01:07.457209243 +0200 +@@ -2,5 +2,5 @@ + + xterm -bg LightGoldenRod -fn 9x15 -geometry 34x4 \ + -vb +sb -T "root permission" \ +- -e sh -c "echo \"Run command with root privileges\"; echo \"Command: $*\"; sux -c \"/usr/bin/env LANG=${LANG} $*\"" ++ -e sh -c "echo \"Run command with root privileges\"; echo \"Command: $*\"; su -c \"/usr/bin/env LANG=${LANG} $*\"" + diff --git a/xdg-menu-translation-bnc463972.patch b/xdg-menu-translation-bnc463972.patch new file mode 100644 index 0000000..f2bf799 --- /dev/null +++ b/xdg-menu-translation-bnc463972.patch @@ -0,0 +1,60 @@ +--- xdg_menu ++++ xdg_menu +@@ -10,6 +10,7 @@ + use Getopt::Long; + use Encode; + use I18N::Langinfo qw(langinfo CODESET); ++use Locale::gettext; + use POSIX qw(locale_h); + + my $Version = "0.2"; +@@ -23,6 +24,7 @@ + my $language = ''; + my $charset = 'iso-8859-1'; + my $root_cmd = 'xdg_menu_su'; ++my $default_textdomain; + + my $die_on_error = 0; + my $verbose = 0; +@@ -1228,7 +1230,23 @@ + return $desktop->{$loc_entry} if defined $desktop->{$loc_entry} && $desktop->{$loc_entry} !~ /^\s*$/; + } + +- return $desktop->{$entry}; ++ my $textdomain = $default_textdomain; ++ ++ if ($desktop->{'X-SUSE-Gettext-Domain'}) { ++ $textdomain = Locale::gettext->domain_raw($desktop->{'X-SUSE-Gettext-Domain'}); ++ $textdomain->codeset('UTF-8'); ++ } ++ ++ my $key = $desktop->{$entry}; ++ my $file = $desktop->{'id'}; ++ my $key_context = "$entry($file): $key"; ++ ++ my $translated = $textdomain->get($key_context); ++ if ($translated eq $key_context) { ++ $translated = $textdomain->get($key); ++ } ++ ++ return $translated; + } + + sub preprocess_menu ($) +@@ -2094,6 +2113,16 @@ + "help" => \$help + ); + ++if (!setlocale(LC_MESSAGES, $language)) ++ { ++ print STDERR "WARNING: invalid language '$language'\n"; ++ $language = setlocale(LC_MESSAGES); ++ print STDERR "Falling back to '$language'\n"; ++ } ++ ++$default_textdomain = Locale::gettext->domain_raw("desktop_translations"); ++$default_textdomain->codeset('UTF-8'); ++ + @language_keys = prepare_language_keys($language); + + $desktop_name = $format unless defined $desktop_name; diff --git a/xdg-menu-twm.patch b/xdg-menu-twm.patch new file mode 100644 index 0000000..d01196b --- /dev/null +++ b/xdg-menu-twm.patch @@ -0,0 +1,77 @@ +--- xdg_menu ++++ xdg_menu +@@ -1320,6 +1320,62 @@ + return 1; + } + ++sub output_twm_menu ($;$$) ++{ ++ my ($menu, $toplevel, $path) = @_; ++ ++ my $output = ''; ++ ++ $path = '' unless defined $path; ++ ++ $toplevel = 1 unless defined $toplevel; ++ ++ my $menu_name = $menu->{'PrepName'}; ++ my $menu_id = "$path-" . $menu->{'Name'}; ++ $menu_id =~ s/\s/_/g; ++ ++ $menu_id = 'xdg_menu' if $toplevel; ++ ++ foreach my $entry (@{$menu->{'entries'}}) { ++ if ($entry->{type} eq 'menu') { ++ $output .= output_twm_menu($entry->{'menu'}, 0, $menu_id); ++ } ++ } ++ ++ $output .= "menu \"$menu_id\" {\n"; ++ $output .= "\"$menu_name\" f.title\n"; ++ ++ foreach my $entry (@{$menu->{'entries'}}) { ++ if ($entry->{type} eq 'desktop') { ++ my $desktop = $entry->{desktop}; ++ ++ my $name = $desktop->{'PrepName'}; ++ my $exec = $desktop->{'PrepExec'}; ++ my $color = ''; ++ ++ $exec =~ s/"/\\"/g; ++ ++ $color = ' ("red":"grey")' if $desktop->{'X-KDE-SubstituteUID'} eq '1' || $desktop->{'X-KDE-SubstituteUID'} eq 'true'; ++ ++ $output .= "\"$name\"$color f.exec \"$exec&\"\n"; ++ } ++ elsif ($entry->{type} eq 'menu') { ++ my $name = $entry->{'menu'}{'PrepName'}; ++ my $id = "$menu_id-" . $entry->{'menu'}{'Name'}; ++ ++ $id =~ s/\s/_/g; ++ ++ $output .= "\"$name\" f.menu \"$id\"\n"; ++ } ++ else { ++ print STDERR "wrong menu entry type: $entry->{type}"; ++ } ++ ++ } ++ $output .= "}\n"; ++ ++ return $output; ++} + + sub output_wmaker_menu ($;$) + { +@@ -2101,6 +2157,11 @@ + + $output = output_openbox3_pipe_menu($menu) + } ++elsif ($format eq 'twm') { ++ ++ print STDERR "WARNING: twm does not support umlauts. Parameter --language '' to output plain ASCII.\n" unless $language eq ''; ++ $output = output_twm_menu($menu) ++} + elsif ($format eq 'readable') { + + $output = output_readable($menu) diff --git a/xdg-menu-xfce4-icon.patch b/xdg-menu-xfce4-icon.patch new file mode 100644 index 0000000..4854dfc --- /dev/null +++ b/xdg-menu-xfce4-icon.patch @@ -0,0 +1,52 @@ +--- xdg_menu ++++ xdg_menu +@@ -1241,10 +1241,11 @@ + return 0 if defined $menu->{'Directory'} && $menu->{'Directory'}->{'NoDisplay'} eq 'true'; + + my $menu_name = $menu->{'Name'}; ++ my $menu_icon = ""; + + if (defined $menu->{'Directory'}) { + my $directory = $menu->{'Directory'}; +- ++ $menu_icon = $menu->{'Directory'}{'Icon'}; + my $directory_name = get_loc_entry($directory, 'Name'); + + if (defined $directory_name) { +@@ -1256,6 +1257,7 @@ + } + + $menu->{'PrepName'} = $menu_name; ++ $menu->{'PrepIcon'} = $menu_icon; + + my $i = 0; + while (defined $menu->{'entries'}[$i]) { +@@ -1620,14 +1622,14 @@ + } + + my $menu_name = $menu->{'PrepName'}; +- ++ my $menu_ico = $menu->{'PrepIcon'}; + $output .= ' ' x $indent; + + if ($indent == 0) { + $output .= "\n" + } + else { +- $output .= "\n"; ++ $output .= "\n"; + } + + foreach my $entry (@{$menu->{'entries'}}) { +@@ -1637,9 +1639,9 @@ + my $name = $desktop->{'PrepName'}; + my $exec = prepare_exec_xfce4($desktop->{Exec}, $desktop); + my $term = ($desktop->{Terminal} eq '1' || $desktop->{Terminal} eq 'true') ? "yes" : "no"; +- ++ my $ico = $desktop->{'Icon'}; + $output .= ' ' x $indent; +- $output .= " \n"; ++ $output .= " \n"; + } + elsif ($entry->{type} eq 'menu') { + $output .= output_xfce4_menu ($entry->{'menu'}, $indent + 1); diff --git a/xdg-menu-xfce4.patch b/xdg-menu-xfce4.patch new file mode 100644 index 0000000..cb9b96e --- /dev/null +++ b/xdg-menu-xfce4.patch @@ -0,0 +1,108 @@ +--- xdg_menu ++++ xdg_menu +@@ -1482,6 +1482,94 @@ + return $output; + } + ++sub prepare_exec_xfce4 ($$) ++{ ++ my ($exec, $desktop) = @_; ++ ++ $exec =~ s/%f//g; ++ $exec =~ s/%F//g; ++ $exec =~ s/%u//g; ++ $exec =~ s/%U//g; ++ $exec =~ s/%d//g; ++ $exec =~ s/%D//g; ++ $exec =~ s/%n//g; ++ $exec =~ s/%N//g; ++ $exec =~ s/%i//g; ++ $exec =~ s/%k//g; ++ $exec =~ s/%v//g; ++ $exec =~ s/%m//g; ++ ++ my $caption = $desktop->{Name}; ++ ++ $exec =~ s/%c/$caption/g; ++ ++ $exec =~ s/%%/%/g; ++ ++ $exec =~ s/\"/"/g; ++ ++ $exec = "$root_cmd $exec" if $desktop->{'X-KDE-SubstituteUID'} eq '1' || $desktop->{'X-KDE-SubstituteUID'} eq 'true'; ++ return $exec; ++} ++ ++ ++ ++sub output_xfce4_menu ($;$) ++{ ++ my ($menu, $indent) = @_; ++ ++ my $output = ''; ++ ++ $indent = 0 unless defined $indent; ++ ++ if ($indent == 0) { ++ $output .= '' . "\n"; ++ $output .= '' . "\n"; ++ $output .= ']>' . "\n\n"; ++ } ++ ++ my $menu_name = $menu->{'PrepName'}; ++ ++ $output .= ' ' x $indent; ++ ++ if ($indent == 0) { ++ $output .= "\n" ++ } ++ else { ++ $output .= "\n"; ++ } ++ ++ foreach my $entry (@{$menu->{'entries'}}) { ++ if ($entry->{type} eq 'desktop') { ++ my $desktop = $entry->{desktop}; ++ ++ my $name = $desktop->{'PrepName'}; ++ my $exec = prepare_exec_xfce4($desktop->{Exec}, $desktop); ++ my $term = ($desktop->{Terminal} eq '1' || $desktop->{Terminal} eq 'true') ? "yes" : "no"; ++ ++ $output .= ' ' x $indent; ++ $output .= " \n"; ++ } ++ elsif ($entry->{type} eq 'menu') { ++ $output .= output_xfce4_menu ($entry->{'menu'}, $indent + 1); ++ } ++ else { ++ print STDERR "wrong menu entry type: $entry->{type}"; ++ } ++ ++ } ++ $output .= ' ' x $indent; ++ ++ if ($indent == 0) { ++ $output .= "\n"; ++ } ++ else { ++ $output .= "\n"; ++ } ++ ++ return $output; ++} ++ + sub output_readable ($;$) + { + my ($menu, $indent) = @_; +@@ -1862,6 +1950,10 @@ + + $output = output_icewm_menu($menu) + } ++elsif ($format eq 'xfce4') { ++ ++ $output = output_xfce4_menu($menu) ++} + elsif ($format eq 'readable') { + + $output = output_readable($menu) diff --git a/xdg-menu.changes b/xdg-menu.changes new file mode 100644 index 0000000..3621185 --- /dev/null +++ b/xdg-menu.changes @@ -0,0 +1,157 @@ +------------------------------------------------------------------- +Wed Dec 17 20:38:49 UTC 2014 - dimstar@opensuse.org + +- On openSUSE > 13.2, xterm has been split into xterm-bin for the + program and xterm for the app launcher. We only need the program, + so conditionally require xterm-bin. + +------------------------------------------------------------------- +Wed Feb 27 19:30:25 UTC 2013 - asterios.dramis@gmail.com + +- Added a patch (xdg-menu-su.patch) to use "su" instead of "sux" to run + commands with root privileges in xdg_menu_su (sux is deprecated). +- Made the package noarch. + +------------------------------------------------------------------- +Mon Aug 31 16:38:49 CEST 2009 - nadvornik@suse.cz + +- accept DefaultLayout node [bnc#529057] + +------------------------------------------------------------------- +Thu Jul 9 12:32:53 CEST 2009 - coolo@novell.com + +- fix requires for Locale::gettext + +------------------------------------------------------------------- +Wed Jun 24 16:02:19 CEST 2009 - nadvornik@novell.com + +- handle desktop files translated with gettext [bnc#463972] + +------------------------------------------------------------------- +Tue Dec 16 18:01:02 CET 2008 - mhrusecky@suse.cz + +- added support for pekwm + +------------------------------------------------------------------- +Fri Jun 1 11:19:02 CEST 2007 - nadvornik@suse.cz + +- do not output top-level menu in icewm format [#273232] + +------------------------------------------------------------------- +Tue Feb 6 11:51:40 CET 2007 - nadvornik@suse.cz + +- added Requires: xterm [#242136] + +------------------------------------------------------------------- +Mon Jan 22 16:03:42 CET 2007 - nadvornik@suse.cz + +- adjusted gnome path [#237126] + +------------------------------------------------------------------- +Fri Mar 24 11:42:15 CET 2006 - pnemec@suse.cz + +- added icon in xfce4 menu + +------------------------------------------------------------------- +Wed Jan 25 21:43:02 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Fri Jul 29 11:53:34 CEST 2005 - nadvornik@suse.cz + +- added twm support + +------------------------------------------------------------------- +Tue Nov 30 13:47:16 CET 2004 - hvogel@suse.de + +- merge *box patches to a single patch +- readd openbox3-pipe output + +------------------------------------------------------------------- +Thu Nov 18 10:34:07 CET 2004 - hvogel@suse.de + +- correct help output to include xfce4 +- merge *box options into one condition +- make the default output for *box a submenu again and + add a --fullmenu option +- fix xfce4 output to not include '&' in menu/app names + +------------------------------------------------------------------- +Tue Nov 9 17:43:56 CET 2004 - hvogel@suse.de + +- added openbox3 support by Marcus Rueckert +- alias fluxbox, openbox to blackbox output + +------------------------------------------------------------------- +Mon Sep 13 16:22:00 CEST 2004 - nadvornik@suse.cz + +- added xfce4 support + +------------------------------------------------------------------- +Tue Mar 16 17:15:47 CET 2004 - nadvornik@suse.cz + +- do not display KDE-specific entries [#36152] +- requires desktop-data + +------------------------------------------------------------------- +Fri Mar 12 18:30:48 CET 2004 - nadvornik@suse.cz + +- fixed paths for kde desktop entries +- remove duplicate entries which came from different desktop files + +------------------------------------------------------------------- +Mon Feb 02 15:07:46 CET 2004 - nadvornik@suse.cz + +- added caching of output +- fixed dependencies [#33294] +- increased version to 0.2 + +------------------------------------------------------------------- +Wed Sep 17 12:02:30 CEST 2003 - nadvornik@suse.cz + +- run su wrapper for entries with X-KDE-SubstituteUID [#30523] + +------------------------------------------------------------------- +Mon Sep 15 13:53:44 CEST 2003 - nadvornik@suse.cz + +- handle desktop files with '&' in file name +- better debugging output + +------------------------------------------------------------------- +Fri Sep 12 14:13:21 CEST 2003 - nadvornik@suse.cz + +- fixed fvwm2 output [#30523] +- fixed bug in parsing desktop files + +------------------------------------------------------------------- +Mon Sep 08 12:18:39 CEST 2003 - nadvornik@suse.cz + +- added blackbox support from mfabian@suse.de +- correctly interpret language in the form LANG_COUNTRY.ENCODING@MODIFIER + +------------------------------------------------------------------- +Fri Sep 05 14:01:28 CEST 2003 - nadvornik@suse.cz + +- more bugs fixed + +------------------------------------------------------------------- +Tue Sep 02 16:18:18 CEST 2003 - nadvornik@suse.cz + +- added fvwm2 support + +------------------------------------------------------------------- +Fri Aug 29 18:59:05 CEST 2003 - nadvornik@suse.cz + +- some fixes + +------------------------------------------------------------------- +Wed Aug 27 13:59:30 CEST 2003 - nadvornik@suse.cz + +- finished support for WindowMaker + +------------------------------------------------------------------- +Mon Aug 25 16:06:59 CEST 2003 - nadvornik@suse.cz + +- new package, needs some more work + diff --git a/xdg-menu.spec b/xdg-menu.spec new file mode 100644 index 0000000..b89da4c --- /dev/null +++ b/xdg-menu.spec @@ -0,0 +1,76 @@ +# +# spec file for package xdg-menu +# +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + +Name: xdg-menu +Version: 0.2 +Release: 0 +Summary: XDG Menus for WindowMaker and other Window Managers +License: GPL-2.0+ +Group: System/GUI/Other +Source0: %{name}.tar.bz2 +Patch0: %{name}-xfce4.patch +Patch1: %{name}-box.patch +Patch2: %{name}-twm.patch +Patch3: %{name}-xfce4-icon.patch +Patch4: %{name}-gnome-path.patch +Patch5: %{name}-icewm.patch +Patch6: %{name}-pekwm.patch +Patch7: %{name}-translation-bnc463972.patch +Patch8: %{name}-accept-defaultlayout-bnc529057.patch +# PATCH-FIX-OPENSUSE xdg-menu-su.patch asterios.dramis@gmail.com -- Use "su" instead of "sux" to run commands with root privileges in xdg_menu_su (sux is deprecated) +Patch9: xdg-menu-su.patch +Requires: desktop-data +Requires: perl-XML-Parser +%if 0%{?suse_version} > 1320 +Requires: xterm-bin +%else +Requires: xterm +%endif +Requires: perl(Locale::gettext) +BuildArch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description +This package contains a Perl script which converts XDG menus to formats +used by WindowMaker and other window managers. + +%prep +%setup -q -n xdg-menu +%patch0 +%patch1 -p1 +%patch2 +%patch3 +%patch4 +%patch5 +%patch6 +%patch7 +%patch8 +%patch9 + +%build + +%install +mkdir -p %{buildroot}%{_bindir} +install -pm 0755 * %{buildroot}%{_bindir} + +%files +%defattr(-,root,root,-) +%{_bindir}/xdg_menu +%{_bindir}/xdg_menu_su + +%changelog diff --git a/xdg-menu.tar.bz2 b/xdg-menu.tar.bz2 new file mode 100644 index 0000000..1d0d816 --- /dev/null +++ b/xdg-menu.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c5203e3102e503b9cf5fc4fec9330317f85d7f1818c89f493b15882e0c727da +size 7934