Skip to content

Linux: autosync on device connected #29

@nefelim4ag

Description

@nefelim4ag

(Moved from: ClockSelect/myevic#229)
I packaged python-evic for aur:
https://aur.archlinux.org/packages/python-evic-git/

For autosync on connect:

    {
        echo '[Unit]'
        echo 'Description=Evic RTC sync'
        echo '[Service]'
        echo 'ExecStart=/usr/bin/evic-usb time'
        echo 'RemainAfterExit=yes'
    } > "$pkgdir/usr/lib/systemd/system/evic-usb-rtc-sync.service"

    {
        echo "# HIDAPI/libusb RTC Sync"
        echo 'ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0416", ATTRS{idProduct}=="5020", RUN+="/usr/bin/systemctl restart evic-usb-rtc-sync"'
    } > "$pkgdir/usr/lib/udev/rules.d/99-nuvoton-hid-rtc-sync.rules"

AFAIK external service for sync time is needed only for systemd systems, as systemd add some restrictions to udev and evic-usb can't see device if running as script in udev.

JFYI, you can close this or say me for do a pull request. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions