source: flair-bin/trunk/tools/scripts/dualshock3.sh@ 83

Last change on this file since 83 was 82, checked in by Sanahuja Guillaume, 5 years ago

support for multiple ds3 in usb

  • Property svn:executable set to *
File size: 841 bytes
RevLine 
[18]1#! /bin/bash
2ARCH_DIR=$(uname -m)
3
[66]4#on kernel >=4.13, ds3 is seen as a mouse
[82]5#search every ds3 connected and disable them
6for id in `xinput --list|grep 'Sony PLAYSTATION(R)3 Controller'|perl -ne 'while (m/id=(\d+)/g){print "$1\n";}'`; do
7 xinput set-prop $id 'Device Enabled' 0
8done
[66]9
[28]10#This script is the only one that calls itself with sudo.
11#As a consequence, only one exception is needed in sudoers (the following 2 lines)
12# Defaults!/opt/flair/flair-bin/tools/scripts/dualshock3.sh setenv
13# uav ALL=(root) /opt/flair/flair-bin/tools/scripts/dualshock3.sh
[18]14
15#we must run as root
16if [ $EUID -ne 0 ]; then
17 exec sudo -E $0 $*
18fi
19
[28]20. ${FLAIR_ROOT}/flair-bin/tools/scripts/ubuntu_cgroup_hack.sh
21
[18]22export LD_LIBRARY_PATH="${OECORE_HOST_SYSROOT}/usr/lib:${OECORE_HOST_SYSROOT}/lib"
[28]23${FLAIR_ROOT}/flair-bin/tools/$ARCH_DIR/unix/dualshock3 $*
Note: See TracBrowser for help on using the repository browser.