Posts by yatar

    Hello, i do this to launch slideshow when i plug an USB KEY :


    I Created this file /storage/.config/system.d/usb-mount.service

    Code
    [Unit]
    Description=Mount USB Drive on %i
    
    [Service]
    Type=oneshot
    RemainAfterExit=true
    ExecStart=/storage/.config/usb-mount.sh
    ExecStop=

    after i run

    Code
    systemctl daemon-reload

    I Created this file /storage/.config/usb-mount.sh

    Bash
    #!/bin/bash
    
    /storage/.config/usb-play.sh & exit;

    and after

    Code
    chmod +x /storage/.config/usb-mount.sh

    I Created this file /storage/.config/usb-play.sh

    Bash
    #!/bin/bash
    
    sleep 10
    /usr/bin/kodi-send --action="slideshow(/media,recursive)"

    and after

    Code
    chmod +x /storage/.config/usb-play.sh

    I Created this file /storage/.config/udev.rules.d/99-usb-autoplay.rules

    Code
    KERNEL=="sd*", SUBSYSTEMS=="block", ACTION=="add", RUN+="/bin/systemctl start usb-mount.service"
    KERNEL=="sd*", SUBSYSTEMS=="block", ACTION=="remove", RUN+="/bin/systemctl stop usb-mount.service"

    and

    Code
    systemctl reload systemd-udevd