Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update and rename Wireless Controller.cfg to Wireless Controller (dis…
…abled).cfg #!/bin/bash input_device_display_name="Data Frog P02" old_value__input_l2="104" new_value__input_l2="+6" old_value__input_r2="105" new_value__input_r2="+7" extend_filename=" (disabled)" sed -i " /input_device/a input_device_display_name = \"$input_device_display_name\" /input_vendor_id/i\# Due to the uncommon nature of this device, the autoconfig file is not active by default. This precaution is taken to avoid potential conflicts with the widely-used Sony-PlayStation4-DualShock4-Controller.cfg file. To activate this configuration, you'll need to remove the comment symbols from the two lines that follow : # Inactivate the controller s/^input_vendor_id/# &/ s/^input_product_id/# &/ " "$1" sed -i " s|input_l2_btn = \"$old_value__input_l2\"|input_l2_axis = \"$new_value__input_l2\"|; s|input_r2_btn = \"$old_value__input_r2\"|input_r2_axis = \"$new_value__input_r2\"|; " "$1" ##################################### # Add multicomment text block that is easy to copy/paste to this file # Define the content to be inserted read -r -d '' insert_content << EOF # RetroArch's in-app feature to create autoconfig files is flawed (libretro/RetroArch#6920) and will attempt to create the 2 lines : # input_l2_btn = "$old_value__input_l2" # input_r2_btn = "$old_value__input_r2" # Those 2 lines are a downgrade from the 2 following lines (copied from Sony_DualShock_4_Controller_v2.cfg) which additionally allow l2/r2 to be polled as analog axises : EOF # Create a unique temporary file tmp_file="/tmp/tmp_file" # Write insert content to the temporary file echo "$insert_content" > "$tmp_file" # Add lines above "world" sed -i "/^input_l2_axis/e cat $tmp_file" "$1" # Remove the temporary file rm "$tmp_file" ########################### mv "$1" "$(echo "$1" | sed "s|.cfg|$extend_filename.cfg|")"
- Loading branch information