Skip to content

Instantly share code, notes, and snippets.

@greyshi
greyshi / waketv.lua
Last active February 15, 2023 02:25 — forked from cmer/waketv.lua
Wake TV when MacOS wakes from sleep (Hammerspoon)
local tv_input = "HDMI_2" -- Input to which your Mac is connected
local mac_address = "80:5B:65:6D:AF:D4"
local switch_input_on_wake = true -- Switch input to Mac when waking the TV
local prevent_sleep_when_using_other_input = true -- Prevent sleep when using other input (ie: watching TV)
local debug = false -- If you run into issues, set to true to enable debug messages
-- You likely will not need to change anything below this line
local tv_name = "MyTV" -- Name of your TV, set when you run `lgtv auth`
local connected_tv_identifiers = {"LG TV", "LG TV SSCR2"} -- Used to identify the TV when it's connected to this computer
local screen_off_command = "off" -- use "screenOff" to keep the TV on, but turn off the screen.