Skip to content

Commit

Permalink
Fixup another annoying syntax error on kingauto and improve a bit
Browse files Browse the repository at this point in the history
Signed-off-by: Pedrozzz0 <[email protected]>
  • Loading branch information
pedrozzz0 committed May 21, 2021
1 parent 54172e4 commit 7b34561
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions kingauto
Original file line number Diff line number Diff line change
Expand Up @@ -24,59 +24,69 @@ get_scrn_state(){
(
while true; do
for gpid in $(pgrep netease) $(pgrep com2us) $(pgrep zuuks) $(pgrep junegaming) $(pgrep junesoftware) $(pgrep sozap) $(pgrep dotemu) $(pgrep playables) $(pgrep playrisedigital) $(pgrep rockstar) $(pgrep blackpanther) $(pgrep noodlecake) $(pgrep linegames) $(pgrep kleientertainment) $(pgrep agaming) $(pgrep generagames) $(pgrep astragon) $(pgrep chucklefish) $(pgrep t2kgames) $(pgrep t2ksports) $(pgrep turner) $(pgrep uplayonline) $(pgrep pubg) $(pgrep dreamotion) $(pgrep snailgames) $(pgrep dexintgames) $(pgrep haegin) $(pgrep panzerdog) $(pgrep igg) $(pgrep gtarcade) $(pgrep naxon) $(pgrep mame4droid) $(pgrep kakaogames) $(pgrep telltalegames) $(pgrep seleuco) $(pgrep innersloth) $(pgrep kiloo) $(pgrep imaginalis) $(pgrep refuelgames) $(pgrep scottgames) $(pgrep clickteam) $(pgrep minigames) $(pgrep headupgames) $(pgrep mobigames) $(pgrep callofduty) $(pgrep ubisoft) $(pgrep ppsspp) $(pgrep cf) $(pgrep feralinteractive) $(pgrep riotgames) $(pgrep playgendary) $(pgrep joymax) $(pgrep deadeffect) $(pgrep blackdesertm) $(pgrep firsttouchgames) $(pgrep standoff2) $(pgrep criticalops) $(pgrep wolvesinteractive) $(pgrep gamedevltd) $(pgrep mojang) $(pgrep miHoYo) $(pgrep miniclip) $(pgrep moontoon) $(pgrep gameloft) $(pgrep netmarble) $(pgrep yoozoogames) $(pgrep eyougame) $(pgrep asphalt) $(pgrep dhlove) $(pgrep fifamobile) $(pgrep wildrift) $(pgrep freefireth) $(pgrep activision) $(pgrep konami) $(pgrep gamevil) $(pgrep madfingergames) $(pgrep supercell) $(pgrep ngame) $(pgrep garena); do
if [[ "$(grep $gpid $toptdir)" ]]; then
if [[ "$(grep $gpid $toptdir)" ]]; then
. "$MODPATH"/libs/libktsr.sh
kmsg3 ""
kmsg "User is playing, applied gaming profile"
kmsg3 ""
renice -n -20 -p $gpid
gaming
sleep 30
for spid in $(pgrep whatsapp) $(pgrep musically) $(pgrep adobe) $(pgrep telegram) $(pgrep netflix) $(pgrep wemesh) $(pgrep discord) $(pgrep youtube) $(pgrep facebook) $(pgrep chrome) $(pgrep browser) $(pgrep instagram) $(pgrep docs) $(pgrep twitch); do
elif [[ "$(grep $gpid $toptdir)" ]]; then
if [[ "$(grep $spid $toptdir)" ]]; then
. "$MODPATH"/libs/libktsr.sh
kmsg3 ""
kmsg "User is using social media, and etc apps. Applied balanced profile"
kmsg3 ""
renice -n -9 -p $spid
balanced
sleep 30
for bpid in $(pgrep geekbench) $(pgrep androbench2) $(pgrep kinemaster) $(pgrep futuremark) $(pgrep cputhrottlingtest) $(pgrep camera) $(pgrep cam) $(pgrep antutu); do
elif [[ "$(grep $bpid $toptdir)" /dev/stune/top-app/tasks ]]; then
if [[ "$(grep $bpid $toptdir)" ]]; then
. "$MODPATH"/libs/libktsr.sh
kmsg3 ""
kmsg "User is running benchmark / heavy apps. Applied extreme profile"
kmsg3 ""
renice -n -20 -p $bpid
extreme
sleep 30
elif [[ "$(cat /sys/class/leds/lcd-backlight/brightness)" ]] || [[ "$(cat /sys/class/backlight/panel*-backlight/brightness)" == "0" ]] || [[ get_scrn_state && $is_scrn_on == "0" ]]; then
fi
done
fi
done
fi
done
if [[ "$(cat /sys/class/leds/lcd-backlight/brightness)" ]] || [[ "$(cat /sys/class/backlight/panel*-backlight/brightness)" == "0" ]] || [[ get_scrn_state && $is_scrn_on == "0" ]]; then
. "$MODPATH"/libs/libktsr.sh
kmsg3 ""
kmsg "Device screen is turned off. Applied battery profile, extended script check time"
kmsg3 ""
battery
sleep 100
elif [[ "$bstatus" == "Charging" ]]; then
. "$MODPATH"/libs/libktsr.sh
kmsg3 ""
kmsg "Device is charging, trying to reduce battery cycles by applying battery profile and extending check time"
kmsg3 ""
battery
sleep 100
elif [[ "$gbpercentage" -le "20" ]] && [[ "$bstatus" == "Discharging" ]]; then
elif [[ "$gbpercentage" -lt "20" ]] && [[ "$bstatus" == "Discharging" ]]; then
. "$MODPATH"/libs/libktsr.sh
kmsg3 ""
kmsg "Device battery is lower than 20%, applied battery profile and extended script check time to reduce battery comsumption"
kmsg3 ""
battery
sleep 100
else
. "$MODPATH"/libs/libktsr.sh
kmsg3 ""
kmsg "No considerable usage found. Applied latency profile"
kmsg3 ""
latency
sleep 15
fi
done
done
done
done


if [[ $avail_ram -lt $full_ram ]] || [[ $avail_ram -eq $full_ram ]]; then
kmsg "Device ram is almost fully in use, dropping caches to free some RAM"
kmsg3 ""
Expand Down

0 comments on commit 7b34561

Please sign in to comment.