The HDMI CEC is a service where users can control the monitor of a device from another device. This uses the cec function of a tv and the functions include turning on and off the tv, and switching the hdmi input.
To download this system, simply use:
curl -sL https://gist.githubusercontent.com/motebus/bbedd8f22c0df9566fadb76f7d7d49d4/raw/851645fcd50a7798ba1d9b49b63ab28ff102c466/script.sh | sudo -E bash -
Source code can also be found at https://github.com/motebus/cec