BlingCorp / bling

Utilities for the awesome window manager
https://blingcorp.github.io/bling/
MIT License
852 stars 50 forks source link

Scratchpad module 'ruled' not found #218

Open MOIS3Y opened 1 year ago

MOIS3Y commented 1 year ago

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;
Nooo37 commented 1 year ago

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

Kasper24 commented 11 months ago

@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
Nooo37 commented 11 months ago

@Kasper24 That looks good!

lorem10 commented 4 months ago

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