menubar: handle nil Name in .desktop files

This commit is contained in:
Roy Crihfield 2015-01-20 13:28:46 -05:00
parent 3bccb0ab73
commit d268dba075
1 changed files with 3 additions and 0 deletions

View File

@ -177,6 +177,9 @@ function utils.parse(file)
if program.Exec then if program.Exec then
-- Substitute Exec special codes as specified in -- Substitute Exec special codes as specified in
-- http://standards.freedesktop.org/desktop-entry-spec/1.1/ar01s06.html -- http://standards.freedesktop.org/desktop-entry-spec/1.1/ar01s06.html
if program.Name == nil then
program.Name = '['.. file:match("([^/]+)%.desktop$") ..']'
end
local cmdline = program.Exec:gsub('%%c', program.Name) local cmdline = program.Exec:gsub('%%c', program.Name)
cmdline = cmdline:gsub('%%[fuFU]', '') cmdline = cmdline:gsub('%%[fuFU]', '')
cmdline = cmdline:gsub('%%k', program.file) cmdline = cmdline:gsub('%%k', program.file)