Gadgetoid / pi400kb

Raw HID keyboard forwarder to turn the Pi 400 into a USB keyboard
MIT License
269 stars 36 forks source link

readme: Autorun example #19

Open second-constantine opened 2 years ago

second-constantine commented 2 years ago

Create a simple systemd unit (for autorun)

# Copy pi400kb
sudo cp pi400kb /usr/sbin/pi400kb

# Create unit
sudo systemctl edit --force --full how_keyboard.service

And add

[Unit]
Description=simple unit for user pi400 how keyboard

[Service]
ExecStart=/usr/sbin/pi400kb
User=root   
Group=root   
Type=simple
Restart=on-failure

[Install]
WantedBy=multi-user.target

Try and enable service

# start
sudo systemctl start how_keyboard.service
# check status
sudo systemctl status how_keyboard.service
# enable autorun if it's ok
sudo systemctl enable how_keyboard.service
Gadgetoid commented 2 years ago
sudo systemctl edit --force --full how_keyboard.service

Today I learned!

We could probably include the systemd unit file in the repository.

rolandog commented 1 year ago

We should also probably mention that libcomposite should be added to /etc/modules (might resolve #39):

echo 'libcomposite' | sudo tee -a /etc/modules