bling icon indicating copy to clipboard operation
bling copied to clipboard

Scratchpad module 'ruled' not found

Open MOIS3Y opened this issue 2 years ago • 4 comments

Hello, I'm not sure whether it was worth opening the issue, I encountered a strange import problem on awesome wm stable 4.3

awesome --version
awesome 4.3 (Too long)
 • Compiled against Lua 5.2.4 (running with Lua 5.2)
 • D-Bus support: ✔
 • execinfo support: ✔
 • xcb-randr version: 1.6

I just add bling as a git submodule in ~/.config/awesome/modules/bling

When trying to start awesomewm:

error: ./bling/module/scratchpad.lua:6: module 'ruled' not found:

Here is this line:

local ruled = capi.awesome.version ~= "v4.3" and require("ruled") or nil

I checked what result I would get in my rc.lua:

-- bottom rc.lua:
local capi = { awesome = awesome, client = client }
print(capi.awesome.version)  --> 4.3

Accordingly, if fix ./bling/module/scratchpad.lua:6

- local ruled = capi.awesome.version ~= "v4.3" and require("ruled") or nil
+ local ruled = capi.awesome.version ~= "4.3" and require("ruled") or nil

Everything is working.

Like I said, I'm not sure if this is a module issue or if I'm the only one experiencing this. In case this is important, I use the nixOS version of awesomewm without modifications which comes with the configuration:

xserver.windowManager.awesome.enable = true;

MOIS3Y avatar Nov 07 '23 14:11 MOIS3Y

Yes the way that the used awesomewm version is detected doesn't work reliably because the version "tag" is set as a build variable and is thus up to the package manager most of the time. So this change would break for arch users and probably others instead. It is a valid issue and I don't have a proper solution right now but open for input

Nooo37 avatar Nov 10 '23 22:11 Nooo37

@Nooo37 I think something similar to this could work?

local _ruled_status, ruled = pcall(function()
    return require("ruled")
end)
if not _ruled_status or not ruledthen
  -- 4.3 code
else
 -- 4.4 code
end

Kasper24 avatar Dec 03 '23 12:12 Kasper24

@Kasper24 That looks good!

Nooo37 avatar Dec 03 '23 18:12 Nooo37

I have this problem too. Is it still not possible to fix it?

Grphq1 avatar Jul 22 '24 21:07 Grphq1