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

(question/request) Get menubar table #1365

Closed
lcpz opened this issue Jan 7, 2017 · 6 comments
Closed

(question/request) Get menubar table #1365

lcpz opened this issue Jan 7, 2017 · 6 comments

Comments

@lcpz
Copy link
Contributor

lcpz commented Jan 7, 2017

$ awesome --version
awesome 4.0 (Harder, Better, Faster, Stronger)
 • Compiled against Lua 5.3.3 (running with Lua 5.3)
 • D-Bus support: ✔
 • execinfo support: ✔
 • RandR 1.5 support: ✔
 • LGI version: 0.9.1

In the previous 3.5.x branch, menubar.menu_gen.generate returns an awful.menu compliant table, while in the 4.0 branch it doesn't anymore.

Can you tell me a clean way to get the same result in current branch too?

This is the best I could do, but it's dirty: this part doesn't work because of the asynchronicity of menu_gen.generate, which terminates after it.

Since the original Freedesktop module was meant to provide a menu, it'd be nice to have this feature back.

@Elv13
Copy link
Member

Elv13 commented Jan 8, 2017

Hello,

I started a multi phase refactor of the menubar (#1329 for phase 1 and there is a gist with phase 2 WIP code). I will probably take care of it in the last PR of that series.

For now, you can copycat my version https://github.com/Elv13/awesome-configs/blob/master/utils/fd_async.lua (demo menu https://github.com/Elv13/awesome-configs/blob/master/customMenu/appmenu.lua). It has:

  • Full async loading
  • Fetching icons using GTK instead of looking around
  • Use the system icon theme
  • Done "right", has no delay even on slow laptops HDD (the example above use Radical for the menus, but awful.menu can also be used if you prefer it)

@psychon
Copy link
Member

psychon commented Jan 8, 2017

This is the best I could do, but it's dirty: this part doesn't work because of the asynchronicity of menu_gen.generate, which terminates after it.

So, run that code in the callback instead of before it?

Since the original Freedesktop module was meant to provide a menu, it'd be nice to have this feature back.

I do not think anything that was provided is lost, is it? The only "problem" might be that awesome no longer freezes while it loads all the menu files, meaning your code has to wait for a callback.

@lcpz
Copy link
Contributor Author

lcpz commented Jan 8, 2017

So, run that code in the callback instead of before it?

Already tried both, the result is the same: generate always terminates after, because it's heavier.

I do not think anything that was provided is lost, is it? The only "problem" might be that awesome no longer freezes while it loads all the menu files, meaning your code has to wait for a callback.

Of course nothing is lost, but still the menu is no longer allowed.

The point is waiting for the callback: how can we synchronize? This is the real problem. I can only think about sockets, but in Lua it'd require a clever design.

@Elv13 Your work is always impressive, but radical is simply huge and it's hard to figure out how to switch to awful.menu in your customMenu/appmenu. Can you lend me a hand, please?

@lcpz
Copy link
Contributor Author

lcpz commented Jan 8, 2017

With @BlueUsername 's patch, my little repo got back on track, even though now I am forced to return an awful.menu instead of an entries table. So I'll be waiting for the refactoring mentioned above.

@Elv13
Copy link
Member

Elv13 commented May 25, 2017

@copycat-killer Can this be closed?

@lcpz
Copy link
Contributor Author

lcpz commented May 26, 2017

Git shows the request has been satisfied, so yeah. Thanks.

@lcpz lcpz closed this as completed May 26, 2017
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

No branches or pull requests

3 participants