Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scratchpad module 'ruled' not found #218

Open
MOIS3Y opened this issue Nov 7, 2023 · 3 comments
Open

Scratchpad module 'ruled' not found #218

MOIS3Y opened this issue Nov 7, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@MOIS3Y
Copy link

MOIS3Y commented Nov 7, 2023

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
Copy link
Member

Nooo37 commented Nov 10, 2023

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 Nooo37 added the bug Something isn't working label Nov 10, 2023
@Kasper24
Copy link
Contributor

Kasper24 commented Dec 3, 2023

@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
Copy link
Member

Nooo37 commented Dec 3, 2023

@Kasper24 That looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants