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

menubar error in awesome 4.0 #1348

Closed
flosse opened this issue Jan 2, 2017 · 9 comments · Fixed by NixOS/nixpkgs#21580
Closed

menubar error in awesome 4.0 #1348

flosse opened this issue Jan 2, 2017 · 9 comments · Fixed by NixOS/nixpkgs#21580

Comments

@flosse
Copy link

flosse commented Jan 2, 2017

Output of awesome --version:

awesome v4.0 (Harder, Better, Faster, Stronger)
 • Compiled against Lua 5.2.3 (running with Lua 5.2)
 • D-Bus support: ✔
 • execinfo support: ✔
 • RandR 1.5 support: ✔
 • LGI version: 0.7.2

How to reproduce the issue:
Start awesome and press super + p

Actual result:

share/awesome/lib/menubar/init.lua:199: attempt to index field 'prompt' (a nil value)

Expected result:
I'd like to see the menu ;-)

I'm running NixOS and this problem occoured with an update from v3.5 to v4.0.

@psychon
Copy link
Member

psychon commented Jan 2, 2017

Somewhere there is a nother bug report about menubar initialisation, but I cannot find it right now.
Could you apply the following diff and grab its output? So far I have no idea.

diff --git a/lib/menubar/init.lua b/lib/menubar/init.lua
index 10ad65c2d..46a9675d9 100644
--- a/lib/menubar/init.lua
+++ b/lib/menubar/init.lua
@@ -196,6 +196,8 @@ end
 -- @return table List of items for current page.
 local function get_current_page(all_items, query, scr)
     scr = get_screen(scr)
+    print("get_current_page called for", scr)
+    print(debug.traceback())
     if not instance.prompt.width then
         instance.prompt.width = compute_text_width(instance.prompt.prompt, scr)
     end
@@ -350,6 +352,7 @@ end
 --- Create the menubar wibox and widgets.
 -- @tparam[opt] screen scr Screen.
 local function initialize(scr)
+    print("initialize called for", scr)
     instance.wibox = wibox({})
     instance.widget = menubar.get(scr)
     instance.wibox.ontop = true

@rasendubi
Copy link

rasendubi commented Jan 2, 2017

I experience the same issue. On the first invocation of Mod4 + p I see

share/awesome/lib/menubar/utils.lua:289: attempt to index field 'Async' (a nil value)

All subsequent invocations yield

share/awesome/lib/menubar/init.lua:199: attempt to index field 'prompt' (a nil value)

I'll try applying the patch now.

@psychon
Copy link
Member

psychon commented Jan 2, 2017

@rasendubi What's you LGI version? lua -e 'print(require("lgi.version"))'

@psychon
Copy link
Member

psychon commented Jan 2, 2017

NixOS has an ancient version of LGI: https://github.com/NixOS/nixpkgs/blob/98a9d815e05dd56aba0f9040d96092335cd90444/pkgs/top-level/lua-packages.nix#L385 (It's 0.7.2 and it is from 2013)

Turns out that menubar needs at least version 0.8.0 (from 2014, so also quite old) since commit 4eb8085.

Edit: I propose "fixing" this by increasing our minimum lgi version from 0.7.1 to 0.8.0 and to make menubar's initialisation more robust.

@rasendubi
Copy link

I'll update LGI now and report back.

@rasendubi
Copy link

Updated LGI to 0.9.1 and I don't see an error now.

@rasendubi
Copy link

Opened: NixOS/nixpkgs#21580

@flosse
Copy link
Author

flosse commented Jan 2, 2017

Updated LGI to 0.9.1 and I don't see an error now.

Works for me too :)
Thanks a lot!

@flosse flosse closed this as completed Jan 2, 2017
@psychon
Copy link
Member

psychon commented Jan 2, 2017

We still have to do something on our side for this, like bumping the code that checks for too-old-lgi. :-)

@psychon psychon reopened this Jan 2, 2017
psychon added a commit to psychon/awesome that referenced this issue Jan 2, 2017
Turns out that menubar already uses features that were only added in
that version.

Fixes: awesomeWM#1348
Signed-off-by: Uli Schlachter <psychon@znc.in>
blueyed pushed a commit that referenced this issue Jan 2, 2017
Turns out that menubar already uses features that were only added in
that version.

Fixes: #1348
Signed-off-by: Uli Schlachter <psychon@znc.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants