attempt to index local 'awesompd' (a boolean value)
Closed this issue · 3 comments
Hi.
I'm trying to install Awesompd 3.4 on Debian Testing (running awesome 3.4).
I've followed the instructions here:
http://awesome.naquadah.org/wiki/Awesompd/3.4
But when I restart awesome, I get the following message on the error log (~/.xsessions-errors):
/home/julian/.config/awesome/rc.lua:19: attempt to index local 'awesompd' (a boolean value)
Line 19 on rc.lua is:
musicwidget = awesompd:create() -- Create awesompd widget
Digging a bit deeper:
On Lua console:
> require("awesompd/awesompd")
error loading module 'awesompd/awesompd' from file './awesompd/awesompd.lua':
./awesompd/awesompd.lua:1151: invalid escape sequence near '\.'
stack traceback:
[C]: in ?
[C]: in function 'require'
stdin:1: in main chunk
[C]: in ?
Line 1151:
local request = format("ls '%s' | grep -P '\.jpg\|\.png\|\.gif|\.jpeg'",
string.gsub(folder, "'", "'\\''"))
If I escape it with \\
, error goes away. Then, I apply a similar fix to line 1164.
Once both lines are fixed, when I try to require the module again in the console, I get:
> require("awesompd/awesompd")
./awesompd/awesompd.lua:19: attempt to index global 'awful' (a nil value)
stack traceback:
./awesompd/awesompd.lua:19: in function 'try_require'
./awesompd/awesompd.lua:27: in main chunk
[C]: in function 'require'
stdin:1: in main chunk
[C]: in ?
Line 19-24:
-- Function for loading modules.
function awesompd.try_require(module)
if awesompd.try_load(awful.util.getdir("config") ..
"/awesompd/" .. module .. ".lua") then
return require('awesompd/' .. module)
else
return require(module)
end
end
awesompd.try_require("utf8")
Lua is v5.2.3.
Hello Julián,
The problem lies in the fact that awesompd for Awesome 3.4 was written when Lua 5.1 was the default. At some point Lua 5.2 was released which slightly changed behaviour related to modules. Since then I have rewritten awesompd to target Lua 5.2, but only the branch that is intended to be used with Awesome 3.5.
So your options are:
- Switch to awesome 3.5 (and get awesompd from the master branch as well)
- Downgrade Lua to 5.1
I would recommend the first one, as awesome 3.5 is fairly stable (although the configs between 3.4 and 3.5 are not compatible).
Thanks, Alexander. I'll try to upgrade to awesome 3.5 from Debian experimental repos without mangling my whole system.