10
10
#
11
11
12
12
rp_module_id=" steamcontroller"
13
- rp_module_desc=" Standalone Steam Controller Driver "
14
- rp_module_help=" Steam Controller Driver from https://github.com/ynsta/steamcontroller "
15
- rp_module_licence=" MIT https://raw.githubusercontent.com/ynsta/steamcontroller/master /LICENSE"
16
- rp_module_repo=" git https://github.com/ynsta/steamcontroller.git master "
13
+ rp_module_desc=" User-mode driver for Steam Controller"
14
+ rp_module_help=" Steam Controller Driver from https://github.com/Ryochan7/sc-controller "
15
+ rp_module_licence=" GPL2 https://raw.githubusercontent.com/Ryochan7/sc-controller/python3 /LICENSE"
16
+ rp_module_repo=" git https://github.com/Ryochan7/sc-controller python3 "
17
17
rp_module_section=" driver"
18
- rp_module_flags=" noinstclean"
19
18
19
+ function _update_hook_steamcontroller() {
20
+ # remove the start command from the previous scriptmodule version
21
+ if rp_isInstalled " $md_id " ; then
22
+ sed -i " /bin\/sc-.*.py/d" /etc/rc.local
23
+ fi
24
+ }
20
25
function depends_steamcontroller() {
21
- getDepends virtualenv python3-dev
26
+ getDepends python3- virtualenv python3-dev python3-setuptools
22
27
}
23
28
24
29
function sources_steamcontroller() {
25
- gitPullOrClone " $md_inst "
30
+ gitPullOrClone
26
31
}
27
32
28
33
function install_steamcontroller() {
29
- cd " $md_inst "
30
- chown -R " $user :$user " " $md_inst "
31
- sudo -u $user bash -c " \
32
- virtualenv -p python3 --no-site-packages \" $md_inst \" ; \
33
- source bin/activate; \
34
- pip3 install libusb1; \
35
- python3 setup.py install; \
36
- "
34
+ # build the driver in a virtualenv created in $md_inst
35
+ virtualenv -p python3 " $md_inst "
36
+ source " $md_inst /bin/activate"
37
+ pip3 install libusb1 evdev
38
+ pip3 install " sccontroller @ file://$md_build "
39
+ deactivate
40
+
41
+ # copy the default controller profiles
42
+ md_ret_files=(" default_profiles" )
37
43
}
38
44
39
45
function enable_steamcontroller() {
40
- local mode =" $1 "
41
- [[ -z " $mode " ]] && mode= " xbox "
46
+ local profile =" $1 "
47
+ [[ -z " $profile " ]] && profile= " XBox Controller "
42
48
43
- local config=" \" $md_inst /bin/sc- $mode .py \" start"
49
+ local config=" \" $md_inst /bin/scc-daemon \" \" $md_inst /default_profiles/ $profile .sccprofile \" start"
44
50
45
51
disable_steamcontroller
46
52
sed -i " s|^exit 0$|${config} \\ nexit 0|" /etc/rc.local
47
- printMsgs " dialog" " $md_id enabled in /etc/rc.local with the following config \n\n$config \n\nIt will be started on next boot."
53
+ printMsgs " dialog" " Steamcontroller enabled in /etc/rc.local with the following profile: \n\n$profile \n\nIt will be started on next boot."
48
54
}
49
55
50
56
function disable_steamcontroller() {
51
- sed -i " /bin\/sc-.*.py/d" /etc/rc.local
57
+ sed -i " /bin\/sc-.*.py/d" /etc/rc.local # previous version
58
+ sed -i " /bin\/scc-daemon.*start/d" /etc/rc.local # current version
52
59
}
53
60
54
61
function remove_steamcontroller() {
@@ -61,6 +68,9 @@ function configure_steamcontroller() {
61
68
# Steam controller keyboard/mouse mode
62
69
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", GROUP="input", MODE="0660"
63
70
71
+ # Valve HID devices over bluetooth hidraw
72
+ KERNEL=="hidraw*", KERNELS=="*28de:*", MODE="0660", GROUP="input", TAG+="uaccess"
73
+
64
74
# Steam controller gamepad mode
65
75
KERNEL=="uinput", MODE="0660", GROUP="input", OPTIONS+="static_node=uinput"
66
76
_EOF_
@@ -69,19 +79,19 @@ _EOF_
69
79
function gui_steamcontroller() {
70
80
local cmd=(dialog --backtitle " $__backtitle " --menu " Choose an option." 22 86 16)
71
81
local options=(
72
- 1 " Enable steamcontroller (xbox 360 mode)"
73
- 2 " Enable steamcontroller (desktop mouse/keyboard mode)"
74
- 3 " Disable steamcontroller "
82
+ 1 " Enable Steamcontroller (Xbox controller mode)"
83
+ 2 " Enable Steamcontroller (Desktop mouse/keyboard mode)"
84
+ 3 " Disable Steamcontroller "
75
85
)
76
86
while true ; do
77
87
local choice=$( " ${cmd[@]} " " ${options[@]} " 2>&1 > /dev/tty)
78
88
if [[ -n " $choice " ]]; then
79
89
case " $choice " in
80
90
1)
81
- enable_steamcontroller xbox
91
+ enable_steamcontroller " XBox Controller "
82
92
;;
83
93
2)
84
- enable_steamcontroller desktop
94
+ enable_steamcontroller " Desktop "
85
95
;;
86
96
3)
87
97
disable_steamcontroller
0 commit comments