Activer / desactiver hyperion avec telecommande

  • creer dans /storage/.config un fichier hyperionswitch.sh comme ceci :
#!/bin/sh
SERVICE='hyperiond'
if ps | grep -v grep | grep $SERVICE > /dev/null
then
killall hyperiond
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":1,"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Hyperion","message":"Disabled","image":"/storage/hyperion/hyperion.png"}}' http://votreip:19444/jsonrpc
else
/storage/hyperion/bin/hyperiond.sh /storage/.config/hyperion.config.json </dev/null >/dev/null 2>&1 &
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":1,"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Hyperion","message":"Enabled","image":"/storage/hyperion/hyperion.png"}}' http://votreip:19444/jsonrpc
fi

ne pas oublier de changer "votre ip"x2 par votre vrai ip locale.

 

  • En ssh, rendre le fichier executable :
chmod +x /storage/.config/hyperionswitch.sh

 

  • Dans le fichier /storage/Userdata/keymaps, éditer le fichier gen.xml (ou keymap.xml, keyboard.xml...) 

Recuperer un ID valide de votre télécommande avec par exemple l'addon Keymap editor (editer votre touche, la ligne sera crée)
Remplacer la ligne par : 

<key id="252">System.Exec("/storage/.config/hyperionswitch.sh")</key>

Evidemment, key ID 252 est l'id de ma touche dédié, la votre sera différente.

 

  • On redémarre, et la touche active / desactive les leds :)

11 commentaires

  1. image 535

    Hello ! Je vous félicite concernant votre travail qui est fantastique

  2. Pretty! This has ƅeen a really wonderful post.
    Тhanks foг supplying tһis information.

  3. Hey! Do you use Twitter? I'd liқe to follow yoս if tһat wouⅼd be ok.
    I'm undoսbtedly enjoying yοur blog and lοoҝ forward tο neԝ updates.

  4. Do you have any video of that? I'd want to find out some
    additional information.

  5. Right now it seems like Drupal is the best blogging platform out
    there right now. (from what I've read) Is that what you're using on your blog?

  6. We're a group of volunteers and starting a new scheme in our community.
    Your web site offered us with valuable information to work on. You have done a formidable job and
    our whole community will be grateful to you.

  7. I am really loving the theme/design of your website. Do you
    ever run into any browser compatibility issues?
    A handful of my blog readers have complained about my blog not working correctly in Explorer but looks great in Firefox.
    Do you have any advice to help fix this issue?

  8. The Pentecostal preacher got his prayers answered when he won a jackpot totalling US31 million.

  9. After initially spending a part of his winnings on some nice things for himself, Billy Bob soon found himself getting into trouble

  10. Its not my first time to pay a quick visit
    this website, i am browsing this site dailly and take pleasant facts from
    here all the time.

  11. <a href="http://desaqq.tk/">http://desaqq.tk/</a>

Écrire un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec une *

Quelle est la troisième lettre du mot lmmo ? :