awesome-wm-widgets icon indicating copy to clipboard operation
awesome-wm-widgets copied to clipboard

github activity widget error

Open petterssonjonas opened this issue 4 years ago • 7 comments

I installed it as supposed to afaik, and i get this error: github-activity-widget.lua:279: attempt to call nil value (method 'buttons')

Am i missing something?

petterssonjonas avatar Jul 15 '20 04:07 petterssonjonas

hmmm, do you use the latest version? There is nothing about buttons on line 279

streetturtle avatar Jul 23 '20 02:07 streetturtle

On latest master the error is the same but from line 259.

petterssonjonas avatar Jul 23 '20 16:07 petterssonjonas

it seems that github_widget doesn't exist at this point (it's nil) which is strange, it was created on line 108, and it works on my machine ;)

Can you share your rc.lua? I checked your gitlab, but didin't find any widgets there

streetturtle avatar Jul 30 '20 01:07 streetturtle

I've put all my widgets in the theme.lua file. Haven't gotten around to cleaning everything up yet. https://gitlab.com/fuzebox/dotfiles/-/tree/master/awesome/themes/powerarrow-gruvbox

petterssonjonas avatar Jul 30 '20 11:07 petterssonjonas

Could you please try to move initialization of the widget inside the theme.at_screen_connect(s), just in case. Otherwise could you let me know how to initialize the modules, after I cloned the repo.

streetturtle avatar Dec 17 '20 01:12 streetturtle

I met the same promblem. I'm sure I follow the instructions in README and use the latest awesome wm.

I'm confused about it. Any advice, please?

kawhicurry avatar Jul 31 '22 04:07 kawhicurry

I spent some time and find a way to solve it. Since I'm not good at lua, I can just get a solution that may work without a clearly explanation.

I noticed that not only github-acitvity has this problem, so do the logout-menu, gitlab. It seems that the problem is :button, which means the actions of button may not work. But the ram widget works well with its button. So I look into its code and find it have an different method to initialize the widget.

The ram works like this:

local ram_widget {} -- do not initialize now
function workder(user_args)
  ram_widget = {
    ...
  }
  ram_widget:buttons(
    ...
  )
end

But the github-etc, gitlab, logout-menu work like this.

gitlab_widget = {
  ... -- initialize immediately
}

function worker(user_args)
  gitlab_widget:buttons(
    ...
  )
end

I believe it's the wrong way to initialize the widget that cause such an error. So I try to change the locatin of the initialization of github-activity just like ram widget do and it works well now.

Hope this helpful to those who need.

kawhicurry avatar Jul 31 '22 08:07 kawhicurry