menu.lua : over the top dumps
Sorky opened this issue · comments
Sorky commented
Environment:
.xinitrc starts awesome with error capture...
exec awesome > ~/.awesome.log 2>&1
awesome v4.2 (Human after all)
• Compiled against Lua 5.3.3 (running with Lua 5.3)
• D-Bus support: ✔
• execinfo support: ✔
• xcb-randr version: 1.5
• LGI version: 0.9.2
Issue:
Long list of messages logged...
ls: cannot access '/home/david/.local/share/applications/': No such file or directory
ls: cannot access '/usr/local/share/applications/': No such file or directory
apport-gtk.desktop
audacious.desktop
<etc>
Cause (AFAICT):
if os.execute(string.format("ls %s &> /dev/null", v)) then
Solution (Best?):
-- add as the first 'require'
local Gio = require("lgi").Gio
-- replace the 'Cause' with...
if Gio.File.new_for_path(v):query_file_type({}) == "DIRECTORY" then
-- remove this (+ CR + whitespace)...
execute = os.execute,
Solution (Alternate):
-- add as the first 'require'
local gfs = require("gears.filesystem")
-- replace the 'Cause' with...
if gfs.is_dir(v) then
-- remove this (+ CR + whitespace)...
execute = os.execute,