diff --git a/lutris/game.py b/lutris/game.py index 035a8fccd..b72bc3de1 100644 --- a/lutris/game.py +++ b/lutris/game.py @@ -276,6 +276,8 @@ class Game(object): def xboxdrv_stop(self): os.system("pkexec xboxdrvctl --shutdown") + if os.path.exists("/usr/share/lutris/bin/resetxpad"): + os.system("pkexec /usr/share/lutris/bin/resetxpad") def beat(self): """Watch the game's process(es).""" diff --git a/share/lutris/bin/resetxpad b/share/lutris/bin/resetxpad new file mode 100755 index 000000000..86c4be6b0 --- /dev/null +++ b/share/lutris/bin/resetxpad @@ -0,0 +1,5 @@ +#!/bin/bash + +rmmod xpad +sleep 2 +modprobe xpad diff --git a/share/polkit-1/actions/net.lutris.resetxpad.policy b/share/polkit-1/actions/net.lutris.resetxpad.policy new file mode 100644 index 000000000..09284ca4f --- /dev/null +++ b/share/polkit-1/actions/net.lutris.resetxpad.policy @@ -0,0 +1,21 @@ + + + + + Lutris + http://lutris.net + + + Reset xpad module + Authentication is required to reset xpad + + yes + yes + yes + + /usr/share/lutris/bin/resetxpad + true + +