Try adding the following lines below the #!/bin/bash line in retropie.sh:
sudo cec-client -p 1 &
sleep 1
sudo kill -9 $(pidof cec-client)
Try adding the following lines below the #!/bin/bash line in retropie.sh:
sudo cec-client -p 1 &
sleep 1
sudo kill -9 $(pidof cec-client)