#!/system/bin/sh
# Nice Tweaks
# PrimeDirective and Sonicxml
# Thanks to mike1986 for the wait for boot code

bash -c "
while busybox [ ! $(logcat -d *:I *:D | grep -c android.intent.action.BOOT_COMPLETED) ]; do sleep 1; done
		busybox renice -15 $(pidof com.android.launcher)
		busybox renice -12 $(pidof com.android.chrome)
		busybox renice -12 $(pidof com.google.android.browser)
		busybox renice -10 $(pidof com.android.phone)
		busybox renice -10 $(pidof com.android.systemui)
		busybox renice -7 $(pidof com.google.android.inputmethod.latin)
		busybox ionice -c2 -n0 $(pidof com.android.camera)
		busybox ionice -c1 -n1 $(pidof com.google.android.music)
		echo 0 >/proc/sys/net/ipv6/conf/all/forwarding
		setprop net.ipv4.compat """ &
