[OnePlus 3 & 3T Cross Device Themes, Apps & Mods] :
Removed some stuff because of issues, not working, or even not existing parameters in build.prop.

Pretty basic but working very well for me.

#!/sbin/sh
#
# Script by 2Tweak
# Last modified 24-08-2019

# Recommended to read before doing all kind of tweaks:
# https://************/most-common-android-optimization-myths-debunked/

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

# First setup
clear

echo
echo "##########################################"
echo "# ROM DEBLOAT SCRIPT #"
echo "##########################################"
echo

mount -o remount,rw /cache
mount -o remount,rw /data
mount -o remount,rw /sdcard
mount -o remount,rw /system

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

echo -n "Shrinking ROM to the bare minimum..."

# app list to remove
applist="
AntHalService
AudioFX
BackupRestoreConfirmation
BasicDreams
BluetoothMidiService
BookmarkProvider
BuiltInPrintService
Calendar
CaptivePortalLogin
CNEService
CallLogBackup
CellBroadcastReceiver
CompanionDeviceManager
Contacts
CtsShimPrebuilt
CtsShimPrivPrebuilt
Development
DocumentsUI
EasterEgg
Eleven
Email
ExactCalculator
Exchange2
Gallery2
HTMLViewer
InputDevices
Jelly
LatinIME
LineageSetupWizard
LiveWallpapersPicker
LockClock
ManagedProvisioning
OneTimeInitializer
OneplusDoze
OneplusPocketMode
PhotoTable
PrintRecommendationService
Profiles
SharedStorageBackup
SimAppDialog
Stk
Tag
Terminal
Traceur
Updater
UserDictionaryProvider
VpnDialogs
WallpaperBackup
WallpaperCropper
WeatherProvider
WfdService
"

for appname in $applist
do
if [ -e /system/app/$appname ]; then
chmod -R 777 /system/app/$appname
rm -rf /system/app/$appname
fi
if [ -e /system/priv-app/$appname ]; then
chmod -R 777 /system/priv-app/$appname
rm -rf /system/priv-app/$appname
fi
done

echo " done!"

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

echo -n "Removing unneeded and junk files...."

# file list to cleanup
filelist="
/cache
/data/anr
/data/backup
/data/cache
/data/dalvik-cache
/data/lineageos_updates
/data/local/tmp
/data/lost+found
/data/misc/bootstat
/data/ota
/data/ota_package
/data/resource-cache
/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
/sdcard/DCIM/thumbnails
/system/bin/bootanimation
/system/media/bootanimation.zip
"

for filename in $filelist
do
if [ -d $filename ]; then
chmod -R 777 $filename
rm -rf $filename/*
fi
if [ -f $filename ]; then
chmod 777 $filename
rm -f $filename
fi
done

# Remove bak, log, tmp and dex files
find /data -iname "*.bak" -type f -exec rm -f {} +
find /data -iname "*.log" -type f -exec rm -f {} +
find /data -iname "*.tmp" -type f -exec rm -f {} +
find /data -iname "*.odex" -type f -exec rm -f {} +
find /data -iname "*.vdex" -type f -exec rm -f {} +

find /system -iname "*.bak" -type f -exec rm -f {} +
find /system -iname "*.log" -type f -exec rm -f {} +
find /system -iname "*.tmp" -type f -exec rm -f {} +

# Some other useless system related files
rm -f /data/stock_boot_*.img.gz
rm -rf /system/vendor/overlay

# Some resets after firmware upgrades
# Reset NFC
rm -f /data/nfc/nfaStorage.bin1
# Remove passwords
rm -f /data/system/locksettings.db
rm -f /data/system/locksettings.db-shm
rm -f /data/system/locksettings.db-wal
rm -f /data/system/gatekeeper.password.key
rm -f /data/system/gatekeeper.pattern.key
# Reset fingerprint
rm -f /data/system/users/0/fpdata/user.db
rm -f /data/system/users/0/settings_fingerprint.xml

echo " done!"

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

echo -n "Disable live display functionality.."

rm -f '/system/vendor/bin/hw/vendor.lineage.livedisplay@2.0-service.oneplus3'
rm -f '/system/vendor/etc/init/vendor.lineage.livedisplay@2.0-service.oneplus3.rc'
fname="/system/vendor/etc/vintf/manifest.xml"

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 <"$fname"

echo $nstr > $fname

echo " done!"

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

echo -n "Cleaning app data..................."

for i in $(ls /data/data/)
do
if [ -e /data/data/$i/cache ]; then
chmod -R 777 /data/data/$i/cache
rm -rf /data/data/$i/cache/*
fi
if [ -e /data/data/$i/code_cache ]; then
chmod -R 777 /data/data/$i/code_cache
rm -rf /data/data/$i/code_cache/*
fi
if [ -e /data/data/$i/files/.Fabric ]; then
chmod -R 777 /data/data/$i/files/.Fabric
rm -rf /data/data/$i/files/.Fabric/*
fi
if [ -e /data/data/$i/files/cache ]; then
chmod -R 777 /data/data/$i/files/cache
rm -rf /data/data/$i/files/cache/*
fi
if [ -e /data/data/$i/app_webview ]; then
chmod -R 777 /data/data/$i/app_webview
# keep cookies for webapp logins
if [ -e /data/data/$i/app_webview/Cookies ]; then
mv -f /data/data/$i/app_webview/Cookies /data/local/tmp/$i.Cookies
fi
rm -rf /data/data/$i/app_webview/*
if [ -e /data/local/tmp/$i.Cookies ]; then
mv -f /data/local/tmp/$i.Cookies /data/data/$i/app_webview/Cookies
fi
fi
done

for j in $(ls /data/app/)
do
if [ -e /data/app/$j/oat/arm ]; then
chmod -R 777 /data/app/$j/oat/arm
rm -rf /data/app/$j/oat/arm/*
fi
if [ -e /data/app/$j/oat/arm64 ]; then
chmod -R 777 /data/app/$j/oat/arm64
rm -rf /data/app/$j/oat/arm64/*
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
rm -rf /sdcard/Android/data/$k/cache/*
fi
done

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

# Remove empty directories
find /data/data -type d -depth -exec rmdir {} + 2>/dev/null
find /sdcard -type d -depth -exec rmdir {} + 2>/dev/null

echo " done!"

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

echo -n "Optimizing app databases............"

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

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

echo " done!"

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

echo -n "Setting log permissions read-only..."

chmod 000 /data/tombstones
chmod 000 /data/system/dropbox
chmod 000 /data/system/graphicsstats
chmod 000 /data/system/procstats
chmod 000 /data/system/usagestats/0/daily
chmod 000 /data/system/usagestats/0/weekly
chmod 000 /data/system/usagestats/0/monthly
chmod 000 /data/system/usagestats/0/yearly

echo " done!"

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

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

fname="/system/build.prop"
tmpvar=$(sed '/.*My settings.*/{s///;q;}' $fname | sed '$d')
echo "$tmpvar" > $fname
echo '
# My settings

# Disable multi user
fw.max_users=1
fw.show_multiuserui=0
fw.show_hidden_users=0
fw.power_user_switcher=0

# Disable logging
logcat.live=disable

# Remove fps limit
debug.gr.swapinterval=0

# Disable boot animation
debug.sf.nobootanimation=1

# Disable USB debugging notification
persist.adb.notify=0

# Disable dithering
persist.sys.use_dithering=0

# Disable scrolling cache
persist.sys.scrollingcache=4

# Optimize Dalvik
dalvik.vm.dexopt-flags=v=n,o=v,m=y

# Disable ring delay
ro.telephony.call_ring.delay=0
ring.delay=0

# Misc power Savings
wifi.supplicant_scan_interval=500
ro.mot.eri.losalert.delay=1000

# End of my settings
' >> $fname
chmod 644 $fname

echo " done!"

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

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

rm -f /system/vendor/etc/gps.conf
touch /system/vendor/etc/gps.conf
echo '# My settings

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

# Debug level
DEBUG_LEVEL=0

# End of my settings
' > /system/vendor/etc/gps.conf
chmod 644 /system/vendor/etc/gps.conf

echo " done!"

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

echo -n "Adding my userinit.sh settings......"

echo '#!/system/bin/sh
# My settings

# Stop perfd - no side effects found
stop perfd

# Switch to noop
for i in /sys/block/mmc*; do
echo noop > $i/queue/scheduler
echo 0 > $i/queue/iostats
done

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

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

# Battery tweaks
chmod 666 /proc/sys/vm/dirty_expire_centisecs
echo 1000 > /proc/sys/vm/dirty_expire_centisecs
chmod 444 /proc/sys/vm/dirty_expire_centisecs
chmod 666 /proc/sys/vm/dirty_writeback_centisecs
echo 2000 > /proc/sys/vm/dirty_writeback_centisecs
chmod 444 /proc/sys/vm/dirty_writeback_centisecs

# Enable power_efficient workqueue
chmod 666 /sys/module/workqueue/parameters/power_efficient
echo 1 > /sys/module/workqueue/parameters/power_efficient
chmod 444 /sys/module/workqueue/parameters/power_efficient

# Disable fsync
chmod 666 /sys/module/sync/parameters/fsync_enabled
echo N > /sys/module/sync/parameters/fsync_enabled
chmod 444 /sys/module/sync/parameters/fsync_enabled

# Disable iostats
chmod 666 /sys/block/sda/queue/iostats
echo 0 > /sys/block/sda/queue/iostats
chmod 444 /sys/block/sda/queue/iostats

# Fstrim on boot
if [ -e /storage/emulated/fstrim ]; then
chmod 777 /storage/emulated/fstrim
/storage/emulated/fstrim /cache
/storage/emulated/fstrim /data
/storage/emulated/fstrim /system
fi

# End of my settings
' > /data/local/userinit.sh
chmod 777 /data/local/userinit.sh

echo " done!"

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

if [ -e /sdcard/Config/Device/fstrim ]; then
echo -n "Optimising disks using fstrim......."
chmod 777 /sdcard/Config/Device/fstrim
/sdcard/Config/Device/fstrim /cache
/sdcard/Config/Device/fstrim /data
/sdcard/Config/Device/fstrim /system
echo " done!"
fi

echo

Further setup (24-08-2019):

Oxygen 9.05 firmware

TWRP 3.3.1-0

Lineage OS 16

Flashkernel r58 (3.18.140)

No Google stuff, using AuroraStore and AuroraDroid as playstores.

Magisk removed (no root),

Default Trebuchet launcher

Copied fstrim to /sdcard/Config/Device to use it in my script and userinit.sh.

I used trimmer app to get a good working fstrim, but probably also available elsewhere.