cmer / lg-tv-control-macos

Automatically wake/sleep and change the input of your LG TV when used as a monitor on macOS
123 stars 12 forks source link

Troubles installing Hammerspoon script #11

Closed freerico closed 1 year ago

freerico commented 1 year ago

Hello, congratulations for the project this is going to be a game changer for me. Thank you so much for putting a guide together. It was a great feeling seeing the tv turning off from the terminal but now I'm stuck at the last step.

Probably due to my inexperience I'm unable to copy the lgtv_init.lua to Hammerspoon. I run the three command lines from the terminal with no errors, just the % sign. Then if I open Hammerspoon console I see the following

2023-05-08 00:46:56: -- Lazy extension loading enabled 2023-05-08 00:46:56: -- Loading ~/.hammerspoon/init.lua 2023-05-08 00:46:56: *** ERROR: ...poon.app/Contents/Resources/extensions/hs/_coresetup.lua:662: module 'lgtv_init' not found: no field package.preload['lgtv_init'] no file '/Users/rico/.hammerspoon/lgtv_init.lua' no file '/Users/rico/.hammerspoon/lgtv_init/init.lua' no file '/Users/rico/.hammerspoon/Spoons/lgtv_init.spoon/init.lua' no file '/usr/local/share/lua/5.4/lgtv_init.lua' no file '/usr/local/share/lua/5.4/lgtv_init/init.lua' no file '/usr/local/lib/lua/5.4/lgtv_init.lua' no file '/usr/local/lib/lua/5.4/lgtv_init/init.lua' no file './lgtv_init.lua' no file './lgtv_init/init.lua' no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/lgtv_init.lua' no file '/Applications/Hammerspoon.app/Contents/Resources/extensions/lgtv_init/init.lua' no file '~/.local/share/hammerspoon/site/lgtv_init.lua' no file '~/.local/share/hammerspoon/site/lgtv_init/init.lua' no file '~/.local/share/hammerspoon/site/Spoons/lgtv_init.spoon/init.lua' no file '/Users/rico/.hammerspoon/lgtv_init.dylib' no file '/Users/rico/.hammerspoon/lgtv_init.so' no file '/usr/local/lib/lua/5.4/lgtv_init.so' no file '/usr/local/lib/lua/5.4/loadall.so' no file './lgtv_init.so' no file '/Applications/Hammerspoon.app/Contents/Frameworks/lgtv_init.dylib' no file '~/.local/share/hammerspoon/site/lib/lgtv_init.dylib' no file '~/.local/share/hammerspoon/site/lib/lgtv_init.so' stack traceback: [C]: in function 'rawrequire' ...poon.app/Contents/Resources/extensions/hs/_coresetup.lua:662: in function 'require' /Users/rico/.hammerspoon/init.lua:1: in main chunk [C]: in function 'xpcall' ...poon.app/Contents/Resources/extensions/hs/_coresetup.lua:723: in function 'hs._coresetup.setup' (...tail calls...)

Looks like it's not able to find the files, right? How can I check for the right path and fix it? Could you please help me out? Thanks again and I wish you a great day.

cmer commented 1 year ago

You need to copy lgtv_init.lua to ~/.hammerspoon. It seems like the file wasn't copied.