diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..76d8903 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,31 @@ +cmake_minimum_required(VERSION 3.10.0) +project(quimby + VERSION 0.0.1 + HOMEPAGE_URL "https://nerdcruft.net" + LANGUAGES CXX +) + +install( + FILES + systemd/system/quimby.service + DESTINATION + /usr/lib/systemd/system/ +) + +install( + FILES + udev/quimby.rules + DESTINATION + /etc/udev/rules.d/ +) + +install( + PROGRAMS + quimby-relay + quimby-cleanup + quimby-setup + DESTINATION + bin +) + +include (CPack) \ No newline at end of file diff --git a/cleanup.py b/quimby-cleanup similarity index 100% rename from cleanup.py rename to quimby-cleanup diff --git a/relay.py b/quimby-relay similarity index 100% rename from relay.py rename to quimby-relay diff --git a/generate.py b/quimby-setup similarity index 99% rename from generate.py rename to quimby-setup index 7deb107..2b128f8 100755 --- a/generate.py +++ b/quimby-setup @@ -125,7 +125,7 @@ files = { } -name = 'pitooth' +name = 'quimby' root = os.path.join('/sys/kernel/config/usb_gadget/', name) try: os.mkdir(root) diff --git a/systemd/system/quimby.service b/systemd/system/quimby.service new file mode 100644 index 0000000..0d4f5a9 --- /dev/null +++ b/systemd/system/quimby.service @@ -0,0 +1,10 @@ +[Unit] +Description=Quimby Input Forwarder +Requires=bluetooth.service + +[Service] +Type=simple +ExecStartPre=/usr/local/bin/quimby-setup quimby +ExecStart=/usr/local/bin/quimby-relay /dev/input/event0 /dev/hidg0 +ExecStop=/usr/local/bin/quimby-cleanup quimby + diff --git a/udev/quimby.rules b/udev/quimby.rules new file mode 100644 index 0000000..ddc1656 --- /dev/null +++ b/udev/quimby.rules @@ -0,0 +1 @@ +ACTION=="add", SUBSYSTEM=="input", KERNEL=="event0", TAG+="systemd", ENV{SYSTEMD_WANTS}="quimby.service"