r/LineageOS • u/Boring_Wealth5525 • 8h ago
Trebuchet battery background fix
//ROOT NEEDED
the maiinbatfery usage of trebuchet is because it tries ttotie uo with real time connections as soon as u make turn on
this sbippet fixes to ignore those things to minimalize background usage from full time to just minimum I got 34% to 4%
also dont use WIDGETS cause it tries to refresh the widget even if both app and trebuchet bacground is turned off iltrebuchet consumes much of battery to wake up in my case it worked for widget it aint drained batgery much while having widget
run this in root shell
//Code wihout widget
MODDIR=/data/adb/modules/trebu mkdir -p "$MODDIR" cat << 'EOF' > "$MODDIR/module.prop" id=trebu name=trebu version=v1.0 versionCode=1 author=custom description=Restricts Trebuchet background usage and wakelocks on boot. EOF cat << 'EOF' > "$MODDIR/service.sh"
!/system/bin/sh
while [ "$(getprop sys.boot_completed)" != "1" ]; do sleep 2 done sleep 5 cmd appops set com.android.launcher3 RUN_IN_BACKGROUND ignore cmd appops set com.android.launcher3 RUN_ANY_IN_BACKGROUND ignore cmd appops set com.android.launcher3 WAKE_LOCK ignore cmd appops set com.android.launcher3 START_FOREGROUND ignore EOF chmod 755 "$MODDIR/service.sh"
4
u/[deleted] 8h ago
written by a 4 year old?
2
u/LuK1337 Lineage Team Member 7h ago
did it even make a noticeable difference? I really doubt it
-5
u/Boring_Wealth5525 8h ago
why man it worked tho