cyl0 / ModernX

A modern OSC UI replacement for MPV that retains the functionality of the default OSC.
545 stars 28 forks source link

Lua error : attempt to call field 'shared_script_property_set' (a nil value) #72

Closed Sharad104 closed 4 months ago

Sharad104 commented 4 months ago

Screenshot_2 using mpv v0.38.0 on my windows 10 its perfectly working fine ! But on archlinux-2024.06.01-x86_64 it's not . mpv behaves like osc=no and modernx UI is not visible. I guess it is based on syntax changes in new lua version (arch using Lua 5.4.7 ) as arch contains latest version of packages (guessing).

Anyway here's some post i found (from arch linux forums) that you may find helpful as i don't know a single thing about lua.

I'm running awesome 3.5 on Arch(obviously), and I'm attempting to set background colors for some of my widgets, but I think I might be using the wrong syntax(i.e. awesome 3 instead of 3.5). Here's what I have in my rc.lua:

memwidget = wibox.widget.textbox()
vicious.register(memwidget, vicious.widgets.mem, "$1%", 13)
memwidget:set_bg("#ccccc7")

When I save and restart awesome I get the error: rc.lua:170: attempt to call field 'set_bg' (a nil value) Here's what got it to work:

memwidget_text = wibox.widget.textbox()
memwidget = wibox.widget.background()
memwidget:set_widget(memwidget_text)
vicious.register(memwidget_text, vicious.widgets.mem, "$1%", 13)
memwidget:set_bg("#ccccc7")

I think people with this issue is minority and modernx.lua would be working for most of the people using old lua version like windows and stable distros like Ubuntu, Debian for now .

Sharad104 commented 4 months ago

my mistake, i was using the old version of modernx.lua . this https://github.com/cyl0/ModernX/pull/65#issue-2040498232 fixed the issue !