From 544853c7056afbfba9d38e83345f589836696bd9 Mon Sep 17 00:00:00 2001 From: Edward Sheldrake Date: Sep 30 2011 11:12:58 +0000 Subject: fix xdg-menu to handle -caption in desktop files (#678827) --- 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 ' ' % \ 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)