From 392976060fdad72026dde3248dcef1cd67d14ee1 Mon Sep 17 00:00:00 2001 From: Michael Leuchtenburg Date: Tue, 13 Jun 2023 16:48:09 -0400 Subject: [PATCH] Add relative path to table of desktop files --- lib/menubar/utils.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/menubar/utils.lua b/lib/menubar/utils.lua index 77945a398..7590b2ee9 100644 --- a/lib/menubar/utils.lua +++ b/lib/menubar/utils.lua @@ -406,7 +406,13 @@ function utils.parse_dir(dir_path, callback) gio.Async.start(do_protected_call)(function() local result = {} - parser(gio.File.new_for_path(dir_path), result) + local f = gio.File.new_for_path(dir_path) + parser(f, result) + for i, entry in ipairs(result) do + local target = gio.File.new_for_path(entry.file) + entry.desktop_file_id = f:get_relative_path(target) + result[i] = entry + end call_callback(callback, result) end) end