You can install samba server on your Vero and make the files on your PC if you prefer but I’ll just walk you through doing it via the terminal since your going to have to go there to change file permissions anyways. You can find instructions on how to ssh into your Vero [here]
In the terminal type each line and then hit return. Also note that case sensitivity is important.
cd
mkdir scripts
cd scripts
nano HDMI_off.sh
This last command will drop you into a text editor. Assuming your doing this via ssh on a PC you should be able to just copy/paste this from this page. When your done editing the file you can ctrl+x, then y, then press enter to save the file and close nano. The text that needs to be in the first file is…
#!/bin/bash
echo audio_off > /sys/class/amhdmitx/amhdmitx0/config
And for our next file
nano HDMI_on.sh
which needs the following…
#!/bin/bash
echo audio_on > /sys/class/amhdmitx/amhdmitx0/config
And the python script
nano HDMI_toggle.py
Which needs the following…
import subprocess
file = open("/home/osmc/scripts/HDMI_status.txt", "r")
inhalt = file.read()
file.close()
file = open("/home/osmc/scripts/HDMI_status.txt", "w")
print(inhalt)
if "off" in inhalt:
subprocess.call(["/home/osmc/scripts/HDMI_on.sh"])
file.write("on")
else:
subprocess.call(["/home/osmc/scripts/HDMI_off.sh"])
file.write("off")
file.close()
Then run these at the terminal…
chmod +x *
echo on >HDMI_status.txt
And now we are just left with making our keymap file which will need to start with figuring out what button you want to use for this. If your using the Vero remote then it may be a bit more complicated due to how heavily customized the keymap for that is. If your using something other than the OSMC remote you can you the keymap editor to find the key id, but you will not be able to program this with that add-on. Additionally if you use keymap editor after making this keymap it will mess it up. The following is a keymap for the OSMC remote, or any other remote that has longpress ability to activate this command when you hold down the OK/select button…
nano ~/.kodi/userdata/keymaps/hdmi_mute.xml
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
<global>
<keyboard>
<return mod="longpress">RunScript(/home/osmc/scripts/HDMI_toggle.py)</return>
</keyboard>
</global>
<FullscreenVideo>
<keyboard>
<return mod="longpress">RunScript(/home/osmc/scripts/HDMI_toggle.py)</return>
</keyboard>
</FullscreenVideo>
<Videos>
<keyboard>
<return mod="longpress">RunScript(/home/osmc/scripts/HDMI_toggle.py)</return>
</keyboard>
</Videos>
<Home>
<keyboard>
<return mod="longpress">RunScript(/home/osmc/scripts/HDMI_toggle.py)</return>
</keyboard>
</Home>
<VideoPlaylist>
<keyboard>
<return mod="longpress"/>
</keyboard>
</VideoPlaylist>
</keymap>
And that should be working as soon as you…
kodi-send -a reloadkeymaps
I tested this, it works, and it doesn’t care if a file is already playing or not, it switches immediately when (with an OSMC remote and the keymap file above) you hold down the OK button. It does not trigger the setting in the GUI to show that it is on or off. That setting will be the setting when kodi is restated. The script will only temporarily toggle the state back and forth.