Automatically wake/sleep and change the input of your LG TV when used as a monitor on macOS.
This script uses Hammerspoon to detect system events such as power off, sleep, and wake.
It makes use of bscpylgtv
to control the TV set. It is included in this repository for Apple Silicon but can easily be compiled for Intel if desired.
For the best result, make sure you configure your TV for PC use. This video is a great place to start.
Use the installation script for a simple and convenient installation process.
Before proceeding, make sure you have Homebrew installed.
Run the following commands in Terminal:
cd /tmp
git clone https://github.com/cmer/lg-tv-control-macos.git
cd lg-tv-control-macos
./install.sh
Change the HDMI input at the top of ~/.hammerspoon/lgtv.lua
script, if needed. Optionally, set debug
to true
if you are running into issues.
This new and updated version no longer uses LGWebOSRemote, and does not require installing Python. It is therefore much easier to get going. 🎉