[openbox/f16] fix xdg-menu to handle -caption in desktop files (#678827)

Miroslav Lichvar mlichvar at fedoraproject.org
Fri Sep 30 11:41:19 UTC 2011


commit 544853c7056afbfba9d38e83345f589836696bd9
Author: Edward Sheldrake <ejsheldrake at gmail.com>
Date:   Fri Sep 30 13:12:58 2011 +0200

    fix xdg-menu to handle -caption in desktop files (#678827)

 xdg-menu |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/xdg-menu b/xdg-menu
index f551adb..72d5ad8 100644
--- a/xdg-menu
+++ b/xdg-menu
@@ -31,7 +31,8 @@ def walk_menu(entry):
 	elif entry.get_type() == gmenu.TYPE_ENTRY and not entry.is_excluded:
 		print '	<item label="%s">' % \
 			escape(entry.get_name().replace('"', ''))
-		command = re.sub(' [^ ]*%[fFuUdDnNickvm]', '', entry.get_exec())
+		command = re.sub(' -caption "%c"| -caption %c', ' -caption "%s"' % entry.get_name(), entry.get_exec())
+		command = re.sub(' [^ ]*%[fFuUdDnNickvm]', '', command)
 		if entry.launch_in_terminal:
 			command = 'xterm -title "%s" -e %s' % \
 				(entry.get_name(), command)


More information about the scm-commits mailing list