Rtl8723de Driver Auto-Installer
Rtl8723de Driver Auto-Installer
/bin/bash
# Script written by TriVoxel (https://TriVoxel.page.link/site)
# Code taken from https://askubuntu.com/questions/983251 and
https://h30434.www3.hp.com/t5/Notebook-Wireless-and-Networking/a/td-p/6477307
# Report any bugs to https://gitlab.com/TriVoxel/rtl8723de-driver-script/issues
# Feel free to modify any part of this script and re-distribute it.
if [ $offline = 0 ];then
echo "Install dependencies? [Y/n]"
read depPoll
if [ $depPoll = Y ];then
## This will just check the operating system. More distributions are
planned for future releases.
## Make it easier for the user to understand which platform they
use and I support
echo -e "Currently supported platforms include:\n\nDebian
Derivatives:\n >Deepin\n >Linux Mint\n >Ubuntu\n >ZorinOS\nArch Linux
Derivatives:\n >Antergos\n >Manjaro\n >RebornOS\n"
echo "Which distribution do you use? (type 'debian' or 'arch')"
read distPoll
if [ $distPoll = debian ]; then
echo "Installing dependencies via Apt..."
sudo apt-get update -y
sudo apt-get install build-essential linux-headers-$(uname
-r) git dkms
elif [ $distPoll = arch ];then
echo "Installing dependencies via Pacman..."
sudo pacman -Syy --noconfirm linux-headers git dkms
else
echo "No valid distribution specified. Exiting."
exit
fi
else
echo "Skipping dependency install..."
sleep .5
fi
fi
## This needs to be skipped for anyone offline. Else it will error out due to
404
if [ $offline = 0 ];then
if [ ! -d $wPath ];then
## Fetch the current WiFi source code from online
echo "Cloning WiFi modules..."
sleep .5
git clone -b extended --single-branch
https://github.com/lwfinger/rtlwifi_new.git $wPath
fi
fi
## Prompts the user to set their antenna. Most vendors use antenna 2 for the
official Windows(R) driver.
echo -e "Which antenna would you like to use? (Default 2)\nType a value
from 1-3 then hit enter:"
read ant
if [[ "1 2 3" == *$ant* && -z $ant ]];then
sudo tee /etc/modprobe.d/rtl8723de.conf <<< "options rtl8723de
ant_sel=$ant"
else
sudo tee /etc/modprobe.d/rtl8723de.conf <<< "options rtl8723de
ant_sel=2"
ant=2
fi
echo "Using antenna $ant."
else
echo "Skipping WiFi install..."
sleep .5
fi
## Bluetooth Support
echo "Install Bluetooth modules? [Y/n]"
read bPoll
if [ $bPoll = Y ];then
if [ $offline = 0 ];then
if [ ! -d $bPath ];then
## Fetch current Bluetooth source code from online
echo "Cloning Bluetooth modules..."
sleep .5
git clone -b master --single-branch
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git $bPath
fi
fi
## Create directories
if [ ! -d /lib/firmware/ ];then
mkdir -v /lib/firmware/
fi
if [ ! -d /lib/firmware/rtl_bt/ ];then
mkdir -v /lib/firmware/rtl_bt/
fi
## Copy bluetooth modules
echo "Installing Bluetooth modules..."
sleep .5
cp -v $bPath/rtl_bt/rtl8723d_fw.bin /lib/firmware/rtl_bt/
cp -v $bPath/rtl_bt/rtl8723d_config.bin /lib/firmware/rtl_bt/
cp -v $bPath/rtlwifi/rtl8723defw.bin /lib/firmware/rtl_bt/
echo "Bluetooth successfully installed."
else
echo "Skipping Bluetooth install..."
sleep .5
fi