build: add systemd unit and udev rules
This commit is contained in:
parent
4eddc80cd0
commit
2215082b87
31
CMakeLists.txt
Normal file
31
CMakeLists.txt
Normal file
@ -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)
|
@ -125,7 +125,7 @@ files = {
|
||||
}
|
||||
|
||||
|
||||
name = 'pitooth'
|
||||
name = 'quimby'
|
||||
root = os.path.join('/sys/kernel/config/usb_gadget/', name)
|
||||
try:
|
||||
os.mkdir(root)
|
10
systemd/system/quimby.service
Normal file
10
systemd/system/quimby.service
Normal file
@ -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
|
||||
|
1
udev/quimby.rules
Normal file
1
udev/quimby.rules
Normal file
@ -0,0 +1 @@
|
||||
ACTION=="add", SUBSYSTEM=="input", KERNEL=="event0", TAG+="systemd", ENV{SYSTEMD_WANTS}="quimby.service"
|
Loading…
Reference in New Issue
Block a user