setup.sh 757 B

123456789101112
  1. #!/usr/bin/env bash
  2. # Per-boot device-permission grant for SteamOS (read-only rootfs -> no persistent udev rule).
  3. # Run ONCE PER BOOT from Desktop Mode: sudo ./setup.sh
  4. #
  5. # /dev/input/event* is already granted to the active session user (logind ACL) -- that's how the evdev
  6. # grab works without this. But /dev/ttyACM* (the nRF CDC link) and /dev/hidraw* are not, so this opens
  7. # them. It does NOT persist across reboots (nothing on the read-only FS changes); re-run after a reboot.
  8. set -e
  9. shopt -s nullglob
  10. for f in /dev/ttyACM*; do chmod a+rw "$f" && echo "opened $f"; done
  11. for f in /dev/hidraw*; do chmod a+rw "$f"; done # only needed for --hidraw gyro/trackpads
  12. echo "done. /dev/input is already session-ACL'd; ttyACM*/hidraw* opened for this boot."