ros2_rmp/scripts/setup.sh

16 lines
555 B
Bash
Raw Permalink Normal View History

2024-05-23 07:18:44 +00:00
#!/bin/bash
# copy script to a system directory
sudo cp ps4_controller_script.sh /etc/udev/rules.d
# Set execute permissions for the script
sudo chmod +x /etc/udev/rules.d/ps4_controller_script.sh
# Create or append the udev rule
echo 'ACTION=="add", SUBSYSTEM=="input", ATTRS{name}=="Wireless Controller", RUN+="/etc/udev/rules.d/ps4_controller_script.sh"' | sudo tee /etc/udev/rules.d/99-ps4-controller.rules
# Reload udev rules
sudo udevadm control --reload-rules
# Provide user feedback
echo "Setup completed. PS4 controller udev rule installed."