Skip to content

Instantly share code, notes, and snippets.

@deadYokai
Last active February 10, 2026 20:24
Show Gist options
  • Select an option

  • Save deadYokai/3f1253ffdff60b4f9bd811119994bb3a to your computer and use it in GitHub Desktop.

Select an option

Save deadYokai/3f1253ffdff60b4f9bd811119994bb3a to your computer and use it in GitHub Desktop.
Simple downloader for DualSense controllers
#!/bin/bash
VID="054c"
DS_PID="0ce6"
DSE_PID="0df2"
DEVICES=("$VID:$DS_PID" "$VID:$DSE_PID")
DW_LINK="https://fwupdater.dl.playstation.net/fwupdater/"
JSON=$(curl -s "$DW_LINK/info.json" | sed 's/[[:space:]]//g')
DS_LAST=$(echo "$JSON" | grep -o '"FwUpdate0004LatestVersion":"[^"]*' | sed 's/.*:"\([^"]*\)/\1/')
DS_EDGE_LAST=$(echo "$JSON" | grep -o '"FwUpdate0044LatestVersion":"[^"]*' | sed 's/.*:"\([^"]*\)/\1/')
check(){
FW_SIZE=950272
SIZE=$(stat -c%s "$1")
if [ "$SIZE" -ne "$FW_SIZE" ]; then
echo "Err: Downloaded file ($1) is $SIZE bytes, expected $FW_SIZE bytes."
exit
fi
}
dw_ds(){
echo "Downloading DualSense firmware ($1) to FWUPDATE0004.bin..."
curl -L -o FWUPDATE0004.bin "$DW_LINK/fwupdate0004/$1/FWUPDATE0004.bin"
check FWUPDATE0004.bin
}
dw_ds_edge(){
echo "Downloading DualSense Edge firmware ($1) to FWUPDATE0044.bin..."
curl -L -o FWUPDATE0044.bin "$DW_LINK/fwupdate0044/$1/FWUPDATE0044.bin"
check FWUPDATE0044.bin
}
prompt(){
echo "Select a controller:"
echo "1) DualSense"
echo "2) DualSense Edge"
read -rp "Enter 1 or 2: " choice
case "$choice" in
1) dw_ds "$DS_LAST" ;;
2) dw_ds_edge "$DS_EDGE_LAST" ;;
*) echo "Invalid choice." ;;
esac
}
echo "DualSense & DualSense Edge firmware downloader"
echo
echo "Last versions:"
echo "DualSense: $DS_LAST"
echo "DualSense Edge: $DS_EDGE_LAST"
echo
found_pid=""
for d in "${DEVICES[@]}"; do
if lsusb | grep -i "$d" > /dev/null; then
found_pid="${d#*:}"
break
fi
done
if [ -z "$found_pid" ]; then
prompt
else
if [ "$found_pid" = "$DS_PID" ]; then
echo "Found DualSense controller"
read -rp "This is correct? [Y/n]" c
c=${c:-Y}
case "$c" in
y|Y) dw_ds $DS_LAST ;;
*) prompt ;;
esac
elif [ "$found_pid" = "$DSE_PID" ]; then
echo "Found DualSense Edge controller"
read -rp "This is correct? [Y/n]" c
c=${c:-Y}
case "$c" in
y|Y) dw_ds_edge $DS_EDGE_LAST ;;
*) prompt ;;
esac
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment