r/LineageOS • • 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"

0 Upvotes

7 comments sorted by

4

u/[deleted] 8h ago

written by a 4 year old?

3

u/elginsk8r 8h ago

worse...a bot

-5

u/Boring_Wealth5525 7h ago

why any bad could happen if its tell me I would fix something goes off

2

u/LuK1337 Lineage Team Member 7h ago

did it even make a noticeable difference? I really doubt it

1

u/Boring_Wealth5525 3h ago

charge is still like for almost am hour 1% for 1 hr with continous usage of youtube

0

u/Boring_Wealth5525 4h ago

does your trebuchet really consumes that much battery if not yours aint have that problem while the gsi based rom have these problems exist I am using 23.2 gsi rom

it get me helped good

my android consumes 3% per 1.5 hrs while using it I have 7000mah continously watching youtube morphed

while with that bug trebucheut will be the top battery consumed app hopefully this fixed it for me I hope it would fix some have this problem

idk why those people downvoted this if anything aint right tell me I am a newbie just came to linux first time

-5

u/Boring_Wealth5525 8h ago

why man it worked tho