[OnePlus 3 & 3T Cross Device Themes, Apps & Mods] :
The script as using it for latest LOS18.1:

#!/sbin/sh
#
# Last modified 2022-01-01

#############################################################

clear
sleep 0.1

echo
echo "#######################################################"
echo "# ANDROID SETUP SCRIPT #"
echo "#######################################################"
echo

# User input to choose what to do
echo "Choose one of the following options:"
echo "S or s = Setup Android without cleaning"
echo "C or c = Deep clean current installation"
echo "F or f = Setup Android including deep clean"
echo "Q or q = Quit the script"
echo

while true
do
# (1) prompt user, and read command line argument
# the second line is producing a backslash to hide output
read -s -n1 answer
echo -n -e "\b \b"

# (2) handle the input we were given
case $answer in
[sS]* ) parm="1"
echo "Your choice:"
echo "Setup of Android without cleaning"
break;;

[cC]* ) parm="2"
echo "Your choice:"
echo "Deep clean of current installation"
break;;

[fF]* ) parm="3"
echo "Your choice:"
echo "Setup of Android including deep clean"
break;;

[qQ]* ) echo "Exited script"
echo
exit;;

* ) echo "Please enter an existing option...";;
esac
done
echo
echo "#######################################################"
echo

#############################################################

echo -n "First script setup..............................."

# Mount or remount drives read-write

umount /system 2>/dev/null
umount /system_root 2>/dev/null

mount -o rw /cache 2>/dev/null
mount -o rw /data 2>/dev/null
mount -o rw /sdcard 2>/dev/null
mount -o rw /system_root 2>/dev/null

# Mount vendor/firmware_mnt
if ! mountpoint -q "/system_root/system/vendor/firmware_mnt"; then
mount /dev/block/by-name/modem /system_root/system/vendor/firmware_mnt
fi

if [ ! -e "/system_root/system/vendor/firmware_mnt" ]; then
echo " done!"
echo ""
echo "ERROR:"
echo "/system/vendor not mounted correctly, exiting script"
exit
fi

echo " done!"

#############################################################

if [ "$parm" == "1" ] || [ "$parm" == "3" ]; then

echo -n "Remove some system apps, modules and services...."

applist="
AntHalService
AudioFX
BasicDreams
BluetoothMidiService
BookmarkProvider
BuiltInPrintService
CallLogBackup
CaptivePortalLogin
CarrierDefaultApp
CellBroadcastLegacyApp
CneApp
CompanionDeviceManager
CtsShimPrebuilt
CtsShimPrivPrebuilt
datastatusnotification
dpmserviceapp
DynamicSystemInstallationService
EasterEgg
Eleven
embms
Gallery2
HTMLViewer
IFAAService
InputDevices
IWlanService
Jelly
LineageSetupWizard
LineageThemesStub
LiveWallpapersPicker
ManagedProvisioning
OneTimeInitializer
PhotoTable
PowerOffAlarm
PrintRecommendationService
QuickAccessWallet
Seedvault
SimAppDialog
SoterService
Stk
Traceur
Updater
VpnDialogs
WallpaperBackup
WallpaperCropper
WAPPushManager
"

# BASIC:
# AudioFX
# Eleven
# Gallery2
# IFAAService
# Jelly
# PowerOffAlarm
# SoterService
# Updater

for appname in $applist
do
if [ -e "/system_root/system/app/$appname" ]; then
chmod -R 777 "/system_root/system/app/$appname" 2>/dev/null
rm -rf "/system_root/system/app/$appname" 2>/dev/null
fi
if [ -e "/system_root/system/priv-app/$appname" ]; then
chmod -R 777 "/system_root/system/priv-app/$appname" 2>/dev/null
rm -rf "/system_root/system/priv-app/$appname" 2>/dev/null
fi
if [ -e "/system_root/system/product/app/$appname" ]; then
chmod -R 777 "/system_root/system/product/app/$appname" 2>/dev/null
rm -rf "/system_root/system/product/app/$appname" 2>/dev/null
fi
if [ -e "/system_root/system/product/priv-app/$appname" ]; then
chmod -R 777 "/system_root/system/product/priv-app/$appname" 2>/dev/null
rm -rf "/system_root/system/product/priv-app/$appname" 2>/dev/null
fi
if [ -e "/system_root/system/system_ext/app/$appname" ]; then
chmod -R 777 "/system_root/system/system_ext/app/$appname" 2>/dev/null
rm -rf "/system_root/system/system_ext/app/$appname" 2>/dev/null
fi
if [ -e "/system_root/system/system_ext/priv-app/$appname" ]; then
chmod -R 777 "/system_root/system/system_ext/priv-app/$appname" 2>/dev/null
rm -rf "/system_root/system/system_ext/priv-app/$appname" 2>/dev/null
fi
if [ -e "/system_root/system/vendor/app/$appname" ]; then
chmod -R 777 "/system_root/system/vendor/app/$appname" 2>/dev/null
rm -rf "/system_root/system/vendor/app/$appname" 2>/dev/null
fi
done

# Remove Soter Ifaa and Alipay blobs
# https://xdaforums.com/oneplus-3/how-to/guide-deblob-alipay-ifaa-tencent-soter-t4064893/
find /system_root/system ! -name "*manager*" -name "*alipay*" -name "*soter*" -name "*ifaa*" -type f -exec rm -f {} + 2>/dev/null

# Remove emergency service
rm -rf /system_root/system/apex/com.android.cellbroadcast 2>/dev/null

# Reduce fonts to the bare minimum
find /system_root/system/fonts ! -name "Roboto*.*" ! -name "DroidSansMono.ttf" ! -name "NotoColorEmoji.ttf" ! -name "NotoSansSymbols-Regular-Subsetted*.ttf" -type f -exec rm -f {} +

# Remove most overlay and related stuff
rm -rf /system_root/system/product/fonts 2>/dev/null
find /system_root/system/product/overlay -maxdepth 1 -mindepth 1 -not -name "*LineageBlackTheme*" -not -name "." -exec rm -rf {} +

echo " done!"

fi

#############################################################

if [ "$parm" == "1" ] || [ "$parm" == "3" ]; then

echo -n "Remove live display functionality................"

rm -f '/system_root/system/vendor/bin/hw/vendor.lineage.livedisplay@2.0-service.oneplus3'
rm -f '/system_root/system/vendor/etc/init/vendor.lineage.livedisplay@2.0-service.oneplus3.rc'

found=0
startstop=0
tstr=""
nstr=""
IFS=$'\n'

while read line
do
if [[ "$line" == *'<hal'* ]]; then
startstop=1
elif [[ "$line" == *'</hal'* ]]; then
startstop=2
elif [[ "$line" == *'livedisplay'* ]]; then
found=1
fi
if [ $startstop -eq 1 ]; then
tstr="${tstr}\n${line}"
elif [ $startstop -eq 2 ]; then
tstr="${tstr}\n${line}"
if [ $found -eq 0 ]; then
nstr="${nstr}${tstr}"
else
found=0
fi
tstr=""
startstop=0
else
if [ "$nstr" == "" ]; then
nstr="${line}"
else
nstr="${nstr}\n${line}"
fi
fi
done < "/system_root/system/vendor/etc/vintf/manifest.xml"

echo "$nstr" > "/system_root/system/vendor/etc/vintf/manifest.xml"

chmod 644 "/system_root/system/vendor/etc/vintf/manifest.xml"

echo " done!"

fi

#############################################################

if [ "$parm" == "1" ] || [ "$parm" == "3" ]; then

if [ -e /sdcard/Config/System/arm64_SystemWebView.apk ]; then
echo -n "Adding Bromite webview (install also after boot!)"
cp -f /sdcard/Config/System/arm64_SystemWebView.apk /system_root/system/product/app/webview/webview.apk
chmod 644 /system_root/system/product/app/webview/webview.apk
echo " done!"
fi

fi

#############################################################

if [ "$parm" == "1" ] || [ "$parm" == "3" ]; then

if [ -e /sdcard/Config/System/bootanimation.zip ]; then
echo -n "Adding customized boot animation................."
rm -f /system_root/system/media/bootanimation.zip
cp -f /sdcard/Config/System/bootanimation.zip /system_root/system/media/bootanimation.zip
chmod 644 /system_root/system/media/bootanimation.zip
echo " done!"
fi

fi

#############################################################

if [ "$parm" == "1" ] || [ "$parm" == "3" ]; then

echo -n "Adding optimised build.prop settings............."

iname="/system_root/system/vendor/build.prop"
jname="/system_root/system/build.prop"
kname="/system_root/system/product/build.prop"
lname="/system_root/system/system_ext/build.prop"

# Replace 3250mv by 3400mv for battery
sed -i 's/3250/3400/g' $jname

# Disable iwlan in build.prop as we actually removed the apk
sed -i 's/persist.data.iwlan.enable=true/persist.data.iwlan.enable=false/g' $jname

# Disable CNE in build.prop as we actually removed the apk
sed -i 's/persist.vendor.cne.feature=1/persist.vendor.cne.feature=0/g' $jname

# Remove all settings we are using in build.prop files
proplist="
persist.vendor.cne.feature
logcat.live
ro.config.nocheckin
profiler.force_disable_err_rpt
profiler.force_disable_ulog
pm.sleep_mode
ro.ril.disable.power.collapse
ro.ril.power_collapse
persist.android.strictmode
ro.kernel.checkjni
ro.kernel.android.checkjni
dalvik.vm.checkjni
dalvik.vm.dexopt-data-only
dalvik.vm.verify-bytecode
dalvik.vm.dexopt-flags
dalvik.vm.execution-mode
ro.mot.eri.losalert.delay
wifi.supplicant_scan_interval
debug.composition.type
debug.sf.hw
persist.debug.wfd.enable
ro.sf.lcd_density
hwui.disable_vsync
debug.sf.no_hw_vsync
hwui.render_dirty_regions
persist.sys.use_dithering
ro.build.selinux
ro.debuggable
ro.secure
ro.build.tags
ro.product.build.tags
ro.system.build.tags
ro.system_ext.build.tags
ro.vendor.build.tags
ro.build.type
ro.product.build.type
ro.system.build.type
ro.system_ext.build.type
ro.vendor.build.type
ro.build.version.security_patch
ro.vendor.build.security_patch
fw.max_users
fw.power_user_switcher
fw.show_hidden_users
fw.show_multiuserui
audio.safemedia.bypass
persist.adb.notify
"
for propname in $proplist
do
tmpvar1=$(sed "/$propname/d" $iname)
echo "$tmpvar1" > $iname
tmpvar2=$(sed "/$propname/d" $jname)
echo "$tmpvar2" > $jname
tmpvar3=$(sed "/$propname/d" $kname)
echo "$tmpvar3" > $kname
tmpvar4=$(sed "/$propname/d" $lname)
echo "$tmpvar4" > $lname
done

# Now add or replace settings
tmpvar5=$(sed '/.*My settings.*/{s///;q;}' $iname | sed '$d')
echo "$tmpvar5" > $iname

echo '
# My settings

# LOGGING & ERRORS
logcat.live=disable
ro.config.nocheckin=1
profiler.force_disable_err_rpt=1
profiler.force_disable_ulog=1

# EFFICIENCY
pm.sleep_mode=1
ro.ril.disable.power.collapse=0
ro.ril.power_collapse=1

persist.android.strictmode=0
ro.kernel.checkjni=0
ro.kernel.android.checkjni=0

dalvik.vm.checkjni=false
dalvik.vm.dexopt-data-only=1
dalvik.vm.verify-bytecode=false
dalvik.vm.dexopt-flags=v=n,o=a,u=y
dalvik.vm.execution-mode=int:jit

ro.mot.eri.losalert.delay=1000
wifi.supplicant_scan_interval=360

debug.composition.type=gpu
debug.sf.hw=1

# MIRACAST DISABLE
persist.debug.wfd.enable=0

# SCREEN
ro.sf.lcd_density=432

hwui.disable_vsync=true
debug.sf.no_hw_vsync=1
hwui.render_dirty_regions=false
persist.sys.use_dithering=0

# SECURITY SPOOFING
ro.build.selinux=0
ro.debuggable=0
ro.secure=1
ro.build.tags=release-keys
ro.product.build.tags=release-keys
ro.system.build.tags=release-keys
ro.system_ext.build.tags=release-keys
ro.vendor.build.tags=release-keys
ro.build.type=user
ro.product.build.type=user
ro.system.build.type=user
ro.system_ext.build.type=user
ro.vendor.build.type=user
ro.build.version.security_patch=2022-01-03
ro.vendor.build.security_patch=2022-01-03

# SINGLE USER
fw.max_users=1
fw.power_user_switcher=0
fw.show_hidden_users=0
fw.show_multiuserui=0

# WARNINGS
audio.safemedia.bypass=true
persist.adb.notify=0
' >> $iname

chmod 644 $iname
chmod 644 $jname
chmod 644 $kname
chmod 644 $lname

echo " done!"

fi

#############################################################

if [ "$parm" == "1" ] || [ "$parm" == "3" ]; then

echo -n "Adding optimised gps.conf settings..............."

rm -f "/system_root/system/vendor/etc/gps.conf"
rm -f "/system_root/system/etc/gps_debug.conf"

touch "/system_root/system/vendor/etc/gps.conf"

echo '# My secure gps only settings

# NTP Server - only one allowed!
NTP_SERVER=nl.pool.ntp.org

# Standalone mode
SUPL_MODE=0

# Disable AGPS injection
AGPS_CONFIG_INJECT=0

# No XTRA testing
XTRA_TEST_ENABLED=0

# AGPS secure settings
SUPL_HOST=localhost
SUPL_PORT=7275
SUPL_TLS_HOST=localhost

# Accuracy all better then 5000m
ACCURACY_THRES=5000

# Give position immediately also without lock
INTERMEDIATE_POS=1

# Debug level
DEBUG_LEVEL=0

# GPS lock for privacy when switched off
GPS_LOCK=3

# Disable emergency SUPL
SUPL_ES=0

# End of my settings
' > "/system_root/system/vendor/etc/gps.conf"

cp -f "/system_root/system/vendor/etc/gps.conf" "/system_root/system/etc/gps_debug.conf"

chmod 644 "/system_root/system/vendor/etc/gps.conf"
chmod 644 "/system_root/system/etc/gps_debug.conf"

echo " done!"

fi

#############################################################

if [ "$parm" == "2" ] || [ "$parm" == "3" ]; then

echo -n "Cleanup system files............................."

# file list to cleanup
filelist="
/cache
/data/anr
/data/backup
/data/cache
/data/dalvik-cache
/data/local/tmp
/data/lost+found
/data/misc/bootstat
/data/ota
/data/ota_package
/data/resource-cache
/data/system/battery-history
/data/system/battery-saver
/data/system/batterystats-checkin.bin
/data/system/batterystats-daily.bin
/data/system/batterystats.bin
/data/system/dropbox
/data/system/graphicsstats
/data/system/install_sessions.xml
/data/system/last-fstrim
/data/system/package_cache
/data/system/procstats
/data/system/syncmanager-log
/data/system/uiderrors.txt
/data/system/usagestats/0/daily
/data/system/usagestats/0/monthly
/data/system/usagestats/0/weekly
/data/system/usagestats/0/yearly
/data/tombstones
/data/xtended_updates
/sdcard/DCIM/.thumbnails
/sdcard/Movies/.thumbnails
/sdcard/Music/.thumbnails
/sdcard/Pictures/.thumbnails
"

for filename in $filelist
do
if [ -d "$filename" ]; then
chmod -R 777 "$filename" 2>/dev/null
rm -rf "${filename:?}"/* 2>/dev/null
fi
if [ -f "$filename" ]; then
chmod 777 "$filename" 2>/dev/null
rm -f "$filename" 2>/dev/null
fi
done

# Remove bak, log, tmp files in /system
find /system_root/system -name "*.bak" -name "*.log" -name "*.tmp" -exec rm -f {} + 2>/dev/null

# Misc stuff
rm -f "/system_root/system/vendor/recovery-from-boot.p" 2>/dev/null
rm -f "/system_root/system/vendor/recovery-from-boot.bak" 2>/dev/null

# App specific
rm -rf /data/data/com.abnamro.nl.mobile.payments/app_dex/oat/arm64/* 2>/dev/null
rm -rf /data/data/org.fdroid.fdroid/files/*.apk 2>/dev/null
rm -rf /data/data/org.videolan.vlc/app_vlc/* 2>/dev/null

# Battery stuff
rm -rf /data/system/batt*.* 2>/dev/null
rm -rf /data/system/batt* 2>/dev/null

echo " done!"

fi

#############################################################

if [ "$parm" == "2" ] || [ "$parm" == "3" ]; then

echo -n "Cleanup app data................................."

# Remove bak, log, tmp, odex, vdex files
find /data -iname "*.bak" -iname "*.log" -iname "*.tmp" -iname "*.odex" -iname "*.vdex" -exec rm -f {} + 2>/dev/null
find /sdcard -iname "*.bak" -iname "*.log" -iname "*.tmp" -iname "*.odex" -iname "*.vdex" -exec rm -f {} + 2>/dev/null

# Some app file cleanup
for i in $(ls /data/data/)
do
if [ -e /data/data/"$i"/cache ]; then
chmod -R 777 /data/data/"$i"/cache 2>/dev/null
rm -rf /data/data/"$i"/cache/* 2>/dev/null
fi
if [ -e /data/data/"$i"/code_cache ]; then
chmod -R 777 /data/data/"$i"/code_cache 2>/dev/null
rm -rf /data/data/"$i"/code_cache/* 2>/dev/null
fi
if [ -e /data/data/"$i"/files/.Fabric ]; then
chmod -R 777 /data/data/"$i"/files/.Fabric 2>/dev/null
rm -rf /data/data/"$i"/files/.Fabric/* 2>/dev/null
fi
if [ -e /data/data/"$i"/files/cache ]; then
chmod -R 777 /data/data/"$i"/files/cache 2>/dev/null
rm -rf /data/data/"$i"/files/cache/* 2>/dev/null
fi
if [ -e /data/data/"$i"/app_webview ]; then
find /data/data/"$i"/app_webview ! -name "Cookies*" -type f -exec rm -f {} + 2>/dev/null
find /data/data/"$i"/app_webview -type d -depth -exec rmdir {} + 2>/dev/null
fi
done

for k in $(ls /sdcard/Android/data/)
do
if [ -e /sdcard/Android/data/"$k"/cache ]; then
chmod -R 777 /sdcard/Android/data/"$k"/cache 2>/dev/null
rm -rf /sdcard/Android/data/"$k"/cache/* 2>/dev/null
fi
done

# App specific
rm -rf /data/data/com.abnamro.nl.mobile.payments/app_dex/oat/arm64/* 2>/dev/null
rm -rf /data/data/org.fdroid.fdroid/files/*.apk 2>/dev/null
rm -rf /data/data/org.videolan.vlc/app_vlc/* 2>/dev/null

echo " done!"

fi

#############################################################

if [ "$parm" == "2" ] || [ "$parm" == "3" ]; then

echo -n "Cleanup empty directories........................"

# Remove empty directories
find /sdcard ! -name "*Downloads*" ! -name "*Camera*" -type d -depth -exec rmdir {} + 2>/dev/null

# Just to be sure they are (still) there...
mkdir /sdcard/Download 2>/dev/null
mkdir -p /sdcard/DCIM/Camera 2>/dev/null
chmod -R 770 /sdcard/Download 2>/dev/null
chmod -R 770 /sdcard/DCIM 2>/dev/null

echo " done!"

fi

#############################################################

echo -n "Optimising app databases........................."

# Optimize databases
for i in $(find /data -name "*.db" -type f)
do
sqlite3 "$i" "VACUUM;" 2>/dev/null
sqlite3 "$i" "REINDEX;" 2>/dev/null
done

for i in $(find /sdcard -name "*.db" -type f)
do
sqlite3 "$i" "VACUUM;" 2>/dev/null
sqlite3 "$i" "REINDEX;" 2>/dev/null
done

echo " done!"

#############################################################

# If available, run fstrim to optimise disks
if [ -e /sdcard/Config/System/fstrim ]; then
echo -n "Optimising disks using fstrim...................."
chmod 777 /sdcard/Config/System/fstrim
/sdcard/Config/System/fstrim /cache 2>/dev/null
/sdcard/Config/System/fstrim /data 2>/dev/null
/sdcard/Config/System/fstrim /sdcard 2>/dev/null
/sdcard/Config/System/fstrim /system 2>/dev/null
echo " done!"
fi

#############################################################

echo -n "Let us finish and unmount disks.................."

umount /system_root/system/vendor/firmware_mnt
umount /system 2>/dev/null
umount /system_root 2>/dev/null

echo " done!"

#############################################################

# User input to choose what to do
echo
echo "#######################################################"
echo
echo "Script completed, what now?"
echo "R or r = Reboot to system"
echo "Q or q = Quit the script"
echo

while true
do
# (1) prompt user, and read command line argument
# the second line is producing a backslash to hide output
read -s -n1 answer
echo -n -e "\b \b"

# (2) handle the input we were given
case $answer in
[rR]* ) echo "Your choice:"
echo "Reboot to system"
echo
sleep 0.5
reboot;;

[qQ]* ) echo "Your choice:"
echo "Quit the script"
echo
exit;;

* ) echo "Please enter an existing option...";;
esac
done
echo