Skip to content

Commit dce8754

Browse files
arnxxaukakra
authored andcommitted
added ff_connect_notify config option to configure.sh
1 parent 2e3b406 commit dce8754

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

configure.sh

+17-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ CONF_FILE=$(grep -sl '^options hid_xpadneo' /etc/modprobe.d/*.conf | tail -1)
1414
: "${CONF_FILE:="/etc/modprobe.d/99-xpadneo-options.conf"}"
1515

1616
# Use getopt NOT getopts to parse arguments.
17-
OPTS=$(getopt -n "$NAME" -o h:m:r: -l help,version,trigger-rumble-mode:,rumble-attenuation: -- "$@")
17+
OPTS=$(getopt -n "$NAME" -o h:m:r:n: -l help,version,trigger-rumble-mode:,rumble-attenuation:,ff_connect_notify: -- "$@")
1818

1919
## Print Help ##
2020
function display_help {
@@ -41,6 +41,14 @@ function check_param {
4141
exit 1
4242
fi
4343
;;
44+
"ff_connect_notify")
45+
if [[ "$value" -gt 2 ]] || [[ "$value" -lt 0 ]];
46+
then
47+
echo "$NAME: $key: Invalid value! Value must be 0 or 1."
48+
exit 1
49+
fi
50+
;;
51+
4452
*)
4553
# key not known, should not be possible
4654
exit 2
@@ -101,7 +109,7 @@ function parse_args {
101109
# If line doesn't exist echo all of the defaults.
102110
mkdir -p "$(dirname "${CONF_FILE}")"
103111
touch "${CONF_FILE}"
104-
echo "options hid_xpadneo disable_deadzones=0 rumble_attenuation=0 trigger_rumble_mode=0" >> "$CONF_FILE"
112+
echo "options hid_xpadneo disable_deadzones=0 rumble_attenuation=0 trigger_rumble_mode=0 ff_connect_notify=1" >> "$CONF_FILE"
105113
fi
106114

107115
eval set -- "$OPTS"
@@ -128,6 +136,13 @@ function parse_args {
128136
shift 2
129137
;;
130138

139+
-n | --ff_connect_notify)
140+
key='ff_connect_notify'
141+
value="${2#*=}"
142+
set_param "$key" "$value"
143+
shift 2
144+
;;
145+
131146
--)
132147
shift
133148
break

docs/config_help

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ NOTE: Short options don't require an equals sign, only long options. EX. -r 3 v
1313
-r, --rumble-attenuation
1414
Attenuate the strength of the trigger force feedback. [0 (none, full rumble) to 100 (max, no rumble)]
1515

16+
-n, --ff_connect_notify
17+
Enable or disable connect notification. [0 (disabled), 1 (enabled)]
1618

1719
NOTE: For more information on configuring xpadneo visit https://atar-axis.github.io/xpadneo/
1820
Or the GitHub page: https://github.com/atar-axis/xpadneo

0 commit comments

Comments
 (0)