I don't know if you are still searching for a solution, but I stumbled upon your thread while struggling with the same problem and I would like to share my solution.
In this guide I use a modified version of the script, originally intended for Raspian. I place it in /storage/.config/, which is the same place where the OpenElec installscript places the regular shutdowncheck.sh file too, so all ATXRaspi related scripts are in the same place.
Step 1Create a new file
/storage/.config/softshutdown.sh with this content:
#!/bin/bash
BUTTON=10
#setup GPIO 10 as output and set to HIGH
echo "$BUTTON" > /sys/class/gpio/export;
echo "out" > /sys/class/gpio/gpio$BUTTON/direction
echo "1" > /sys/class/gpio/gpio$BUTTON/value
#keep GPIO 10 high for at least 4 seconds for shutdown, 1s for reboot (same as pressing ATXRaspi button)
SLEEP=4 #set to 4 for shutdown, set to 1 for reboot.
echo "ATXRaspi button press for: $SLEEP seconds..."
/bin/sleep $SLEEP
#restore GPIO 10
echo "0" > /sys/class/gpio/gpio$BUTTON/value
Step 2You can skip this step, if you don't want a script for ATXRaspi-Rebooting. I suppose regular rebooting should work fine too, but I never tested it in conjunction with ATXRaspi. IMHO, since we are using an ATXRaspi, it doesn't hurt to handle both shutdowns and reboots through it.
Copy
softshutdown.sh to
softreboot.sh and modify line 10 to
SLEEP=1 #set to 4 for shutdown, set to 1 for reboot.
Step 3Make the files executable with
chmod 777 /storage/.config/softshutdown.sh
chmod 777 /storage/.config/softreboot.sh
Step 4You now need to modify the command from the shutdownmenu of your skin, located in the file
DialogButtonMenu.xml. If you use Kodi's default skin, which is "Estuary" in Kodi 17, this file is located in
/usr/share/kodi/addons/skin.estuary/xml/DialogButtonMenu.xml.
You could directly edit this file, I however prefer a different approach:
- Download a copy of
Estuary from its Github.
- Look for the file addon.xml
- In line 2 of this file change
id="skin.estuary" to
id="skin.estuary.mod" and
name="Estuary" to
name="Estuary (Mod)"- Then edit the file xml/DialogButtonMenu.xml
- Search for the line
<onclick>Powerdown()</onclick>- Change it to
<onclick>System.Exec("/storage/.config/softshutdown.sh")</onclick>- Search for the line
<onclick>Reset()</onclick>- Change it to
<onclick>System.Exec("/storage/.config/softreboot.sh")</onclick>Now install your modified version of Estuary, which will now be installed to
/storage/.kodi/addons/skin.estuary.mod/. The advantage of this approach is that this skin inside the storage-folder will not be overwritten during ta system update.
Of course, if you prefer using any other theme you will have to edit its XML similarly.[/list]