mirror of
https://github.com/lutris/lutris
synced 2024-10-14 19:53:53 +00:00
Add script to restore xpad driver after using xboxdrv
This commit is contained in:
parent
a9b8e071b1
commit
ee48883b89
|
@ -276,6 +276,8 @@ class Game(object):
|
||||||
|
|
||||||
def xboxdrv_stop(self):
|
def xboxdrv_stop(self):
|
||||||
os.system("pkexec xboxdrvctl --shutdown")
|
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):
|
def beat(self):
|
||||||
"""Watch the game's process(es)."""
|
"""Watch the game's process(es)."""
|
||||||
|
|
5
share/lutris/bin/resetxpad
Executable file
5
share/lutris/bin/resetxpad
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
rmmod xpad
|
||||||
|
sleep 2
|
||||||
|
modprobe xpad
|
21
share/polkit-1/actions/net.lutris.resetxpad.policy
Normal file
21
share/polkit-1/actions/net.lutris.resetxpad.policy
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE policyconfig PUBLIC
|
||||||
|
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
|
||||||
|
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
|
||||||
|
<policyconfig>
|
||||||
|
|
||||||
|
<vendor>Lutris</vendor>
|
||||||
|
<vendor_url>http://lutris.net</vendor_url>
|
||||||
|
|
||||||
|
<action id="net.lutris.resetxpad.pkexec.run">
|
||||||
|
<description>Reset xpad module</description>
|
||||||
|
<message>Authentication is required to reset xpad</message>
|
||||||
|
<defaults>
|
||||||
|
<allow_any>yes</allow_any>
|
||||||
|
<allow_inactive>yes</allow_inactive>
|
||||||
|
<allow_active>yes</allow_active>
|
||||||
|
</defaults>
|
||||||
|
<annotate key="org.freedesktop.policykit.exec.path">/usr/share/lutris/bin/resetxpad</annotate>
|
||||||
|
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
|
||||||
|
</action>
|
||||||
|
</policyconfig>
|
Loading…
Reference in a new issue