This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xboxdrv-daemon.html
154 lines (113 loc) · 4.86 KB
/
xboxdrv-daemon.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy for Linux/x86 (vers 25 March 2009), see www.w3.org" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>xboxdrv-daemon</title>
<link rel="stylesheet" href="default.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2" />
<link rel="home" href="index.html" title="xboxdrv-daemon" />
</head>
<body>
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center"><span class="application">xboxdrv-daemon</span></th>
</tr>
</table>
<hr />
</div>
<div class="refentry" title="xboxdrv-daemon">
<a id="xboxdrv" name="xboxdrv"></a>
<div class="titlepage"></div>
<div class="refnamediv">
<h2>Name</h2>
<p><span class="application">xboxdrv-daemon</span> — A simple daemon that automatically launches xboxdrv when it detects a controller.</p>
</div>
<div class="refsynopsisdiv" title="Synopsis">
<h2>Synopsis</h2>
<div class="cmdsynopsis">
<p><code class="command">xboxdrv</code> [OPTION...] [--] {XBOXDRV} [ARGS...]</p>
</div>
</div>
<div class="refsect1" title="DESCRIPTION">
<a id="id2848279" name="id2848279"></a>
<h2>DESCRIPTION</h2>
<div class="variablelist">
<dl>
<dt><span class="term"><code class="option">-h</code>, <code class="option">--help</code></span></dt>
<dd>
<p>Display help text and exit.</p>
</dd>
<dt><span class="term"><code class="option">--version</code></span></dt>
<dd>
<p>Print the version number and exit.</p>
</dd>
<dt><span class="term"><code class="option">-v</code>, <code class="option">--verbose</code></span></dt>
<dd>
<p>Be verbose with printed output.</p>
</dd>
<dt><span class="term"><code class="option">-a FILENAME, --attach=FILENAME</code></span></dt>
<dd>
<p>Launch EXE when a new controller is connected</p>
</dd>
<dt><span class="term"><code class="option">-d FILENAME, --detach=FILENAME</code></span></dt>
<dd>
<p>Launch EXE when a controller is detached</p>
</dd>
<dt><span class="term"><code class="option">-x FILENAME, --xboxdrv=FILENAME</code></span></dt>
<dd>
<p>Set the location of the xboxdrv executable</p>
</dd>
</dl>
</div>
</div>
<div class="refsect1" title="Running xboxdrv via xboxdrv-daemon">
<a id="id2843404" name="id2843404"></a>
<h2>Running xboxdrv via xboxdrv-daemon</h2>
<p><span class="command"><strong>xboxdrv-daemon</strong></span> allows you to run xboxdrv automatically whenever you plug in a gamepad. Since xboxdrv-daemon.py needs to know where xboxdrv is located you need to supply the location of the xboxdrv binary manually if its not located in <code class="envar">PATH</code>:</p>
<pre class="programlisting">
% xboxdrv-daemon --xboxdrv ./xboxdrv
</pre>
<p>You can pass arguments to xboxdrv after a double dash '--':</p>
<pre class="programlisting">
% xboxdrv-daemon -- --buttonmap B=A,X=A,Y=A
</pre>
<p>You can also run scripts that get started after xboxdrv is started via:</p>
<pre class="programlisting">
% xboxdrv-daemon \
--attach /home/juser/xboxdrv_attach \
--detach /home/juser/xboxdrv_deatach
</pre>
<p>This is useful in Kiosk settings, such as a media center PC, where you might want to restart the media center to have the controller working properly after it got attached.</p>
<p>Note that you can't dynamically reconfigurabilty xboxdrv when you launch it automatically via the daemon, so using this daemon isn't generally recommend.</p>
<p>When you want configurability and automatic launching, it is recomment that you write little startup scripts for your games, such as this:</p>
<pre class="programlisting">
#!/bin/sh
# Start xboxdrv and remember its PID in the variable XBOXPID
xboxdrv --trigger-as-button -s &amp;
XBOXPID=$!
# Give xboxdrv a second to startup and create the device
sleep 1
# Launch your favorite game
your_favorite_game
# Kill xboxdrv and wait for it to finish
kill $XBOXPID
wait $XBOXPID
# EOF #
</pre>
<p>That way you can individually configure every game and still not have to worry about launching xboxdrv manually.</p>
</div>
<div class="refsect1" title="See also">
<a id="id2843491" name="id2843491"></a>
<h2>See also</h2>
<p>xboxdrv(1)</p>
</div>
</div>
<div class="navfooter">
<hr />
</div>
</body>
</html>