cec-simplest - Simple app to control the play and pause of Chromecast using a keyboard attached to a raspberry pi. The app is meant to be on all the time, it stays idle until a key is pressed. I'm using this because my LG 42LE5300 although it supports CEC, it does not send the pause and play keypresses from the remote to the Chromecast.
Code taken from following sources: http://michael.dipperstein.com/keypress.html - Linux Wait for Key Press https://drgeoffathome.wordpress.com/2014/08/14/a-simple-libcec-example-for-the-raspberry-pi/ - A simple libCEC example for the Raspberry Pi