[Nexus 4 General] themike10452:
I will post a new one here ;)

*Script download link in the bottom*

-------------------------------------------------------

Alright so here's a quick explanation of how to edit this script to suite your needs:

#!/system/bin/sh

##PROFILES####################

bundi() {
#bundi22's iPhone 5 profile
blue="168 0 39 119 0 6 0 2 0 2"
red="168 0 39 119 0 6 0 2 0 2"
green="168 0 39 119 0 6 0 2 0 2"
cal="255 255 255"
}

mohit() {
#mohitgalaxy3 profile
blue="161 0 0 70 0 4 2 67 16 2"
red="161 0 0 70 0 4 2 67 16 2"
green="161 0 0 70 0 4 2 67 16 2"
cal="255 255 255"
}

PAHB() {
#PA Half Breed profile
blue="378 64 68 118 0 25 4 66 32 1"
green="378 64 68 118 0 25 4 66 32 1"
red="378 64 68 118 0 25 4 66 32 1"
cal="255 255 255"
}

Ghu() {
#Kel_Ghu_gamma profile
blue="147 0 0 71 0 3 0 71 0 2"
green="147 0 0 71 0 3 0 71 0 2"
red="147 0 0 71 0 3 0 71 0 2"
cal="255 255 255"
}

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

finish() {
#apply selected profile

echo blue
echo "old: `cat /sys/devices/platform/mipi_lgit.1537/kgamma_blue`"
echo "new: $blue"
echo "$blue" > /sys/devices/platform/mipi_lgit.1537/kgamma_b

echo green
echo "old: `cat /sys/devices/platform/mipi_lgit.1537/kgamma_green`"
echo "new: $green"
echo "$green" > /sys/devices/platform/mipi_lgit.1537/kgamma_g

echo red
echo "old: `cat /sys/devices/platform/mipi_lgit.1537/kgamma_red`"
echo "new: $red"
echo "$red" > /sys/devices/platform/mipi_lgit.1537/kgamma_r

echo calibration
echo "old: `cat /sys/devices/platform/kcal_ctrl.0/kcal`"
echo "new: $cal"
echo "$cal" > /sys/devices/platform/kcal_ctrl.0/kcal
}

apply() {
clear
cal=0
echo Applying "$1" profile
$1 2>/dev/null
if [ "$cal" == "0" ]; then
clear
echo $1 profile not found
exit 99
fi
finish 2>/dev/null
}
[Color=blue]
##miscellaneous settings############

misc() {
echo ""
echo applying miscellaneous settings ...

##*** add your misc commands below ***##

##enable doubletap2wake
#echo "1" > /sys/android_touch/doubletap2wake

##set number of cores boosted on touch
#echo "2" > /sys/module/msm_hotplug/cpus_boosted
}
[/color]
[Color=green]
##############################
#Available color profiles: (case sensitive)
#- mohit
#- bundi
#- PAHB
#- Ghu
##############################[/color]

##execution of all commands >>

apply [color=red]mohit[/color] color profile;
misc
exit

Look at the last 3 lines, mohit profile is shown in red, it is there by default, you can change it to the color profile you want, the available profiles are listed a few lines above (in green)

If you look also to the misc section (blue), you may insert any other commands you want to be executed on boot, such as enabling dt2w, etc... 2 commands are already there, you can un-comment them to use them.

I personally keep the script under /data/local/userini.sh so it survives after flashing a new ROM. Don't forget to give the file proper permissions.

[MENTION=3946657]xanthrax[/MENTION] you might wanna add this to OP ;)

Download link below: (mediafire)

Download

---------- Post added at 08:29 PM ---------- Previous post was at 08:26 PM ----------

Ooops someone posted my code without giving proper credit ;) :P

Sent using my nexus⁴ running Purity 4.4.2 (Dalvik) + T.A.R.D.I.S powered by HellsDoctor R18 Linux 3.4.79 kernel.