- Remove field codes from commands in xdg-menu (#452403)

- Add support for launching applications in xterm to xdg-menu
epel9
Miroslav Lichvar 17 years ago
parent be11092597
commit 578b9cd5e4

@ -1,6 +1,6 @@
Name: openbox Name: openbox
Version: 3.4.7.2 Version: 3.4.7.2
Release: 3%{?dist} Release: 4%{?dist}
Summary: A highly configurable and standards-compliant X11 window manager Summary: A highly configurable and standards-compliant X11 window manager
Group: User Interface/Desktops Group: User Interface/Desktops
@ -134,6 +134,10 @@ rm -rf %{buildroot}
%changelog %changelog
* Fri Aug 01 2008 Miroslav Lichvar <mlichvar@redhat.com> - 3.4.7.2-4
- Remove field codes from commands in xdg-menu (#452403)
- Add support for launching applications in xterm to xdg-menu
* Tue Jun 10 2008 Miroslav Lichvar <mlichvar@redhat.com> - 3.4.7.2-3 * Tue Jun 10 2008 Miroslav Lichvar <mlichvar@redhat.com> - 3.4.7.2-3
- Clean up properties after gdm in session scripts (#444135) - Clean up properties after gdm in session scripts (#444135)
- Add license to xdg-menu script - Add license to xdg-menu script

@ -19,7 +19,7 @@
# Miroslav Lichvar <mlichvar@redhat.com> # Miroslav Lichvar <mlichvar@redhat.com>
import gmenu, sys import gmenu, re, sys
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
def walk_menu(entry): def walk_menu(entry):
@ -29,10 +29,14 @@ def walk_menu(entry):
map(walk_menu, entry.get_contents()) map(walk_menu, entry.get_contents())
print '</menu>' print '</menu>'
elif entry.get_type() == gmenu.TYPE_ENTRY and not entry.is_excluded: elif entry.get_type() == gmenu.TYPE_ENTRY and not entry.is_excluded:
print """ print ' <item label="%s">' % escape(entry.get_name())
<item label="%s"> command = re.sub(' [^ ]*%[fFuUdDnNickvm]', '', entry.get_exec())
<action name="Execute"><command>%s</command></action> if entry.launch_in_terminal:
</item> """ % (escape(entry.get_name()), escape(entry.get_exec())) command = 'xterm -title "%s" -e %s' % \
(entry.get_name(), command)
print ' <action name="Execute">' + \
'<command>%s</command></action>' % escape(command)
print ' </item>'
if len(sys.argv) > 1: if len(sys.argv) > 1:
menu = sys.argv[1] + '.menu' menu = sys.argv[1] + '.menu'

Loading…
Cancel
Save