From d461de637f55e84fb2424f60d2ddc032d500a017 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Aug 01 2008 12:10:36 +0000 Subject: - Remove field codes from commands in xdg-menu (#452403) - Add support for launching applications in xterm to xdg-menu --- diff --git a/openbox.spec b/openbox.spec index 3ed5bfe..ed2dfab 100644 --- a/openbox.spec +++ b/openbox.spec @@ -1,6 +1,6 @@ Name: openbox Version: 3.4.7.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A highly configurable and standards-compliant X11 window manager Group: User Interface/Desktops @@ -134,6 +134,10 @@ rm -rf %{buildroot} %changelog +* Fri Aug 01 2008 Miroslav Lichvar - 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 - 3.4.7.2-3 - Clean up properties after gdm in session scripts (#444135) - Add license to xdg-menu script diff --git a/xdg-menu b/xdg-menu index cd9e3ee..0a8c1bc 100644 --- a/xdg-menu +++ b/xdg-menu @@ -19,7 +19,7 @@ # Miroslav Lichvar -import gmenu, sys +import gmenu, re, sys from xml.sax.saxutils import escape def walk_menu(entry): @@ -29,10 +29,14 @@ def walk_menu(entry): map(walk_menu, entry.get_contents()) print '' elif entry.get_type() == gmenu.TYPE_ENTRY and not entry.is_excluded: - print """ - - %s - """ % (escape(entry.get_name()), escape(entry.get_exec())) + print ' ' % escape(entry.get_name()) + command = re.sub(' [^ ]*%[fFuUdDnNickvm]', '', entry.get_exec()) + if entry.launch_in_terminal: + command = 'xterm -title "%s" -e %s' % \ + (entry.get_name(), command) + print ' ' + \ + '%s' % escape(command) + print ' ' if len(sys.argv) > 1: menu = sys.argv[1] + '.menu'