Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: autosync on device connected #29

Open
nefelim4ag opened this issue Dec 29, 2016 · 1 comment
Open

Linux: autosync on device connected #29

nefelim4ag opened this issue Dec 29, 2016 · 1 comment

Comments

@nefelim4ag
Copy link

(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.

@nefelim4ag
Copy link
Author

ClockSelect#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant