[Q] shell scripting syntax? - Sony Xperia P, U, Sola, Go

This is actually related to the Xperia U but i'm sure it will be identical for the Xperia S and P.
Via tasker i'm running a Shell script to control the LED bar lights used during a notification.
I've found a way to acces them and turn each LED on/off (left-middle-right and colors) but now I'm looking for the right syntax to increase and decrease the value of one LED so I can make them fade in en out.
Via Pent (tasker) I've got this (only fade in):
dir=/sys/class/leds;
val=0;
while [ $val != 256 ];
do
echo $val > $dir/m-key-red/brightness;
echo $val > $dir/m-key-green/brightness;
echo $val > $dir/m-key-blue/brightness;
let val=$val+1;
done
but I continue to get the error let: arith: syntax error: "val=0+1" which is an indication that i'm using the wrong syntax.
does anyone know which syntax to use within the Xperia NXT 2012 shell?
ps. i'm aware of the illumination bar notification app, but would very much like to create my own

let val = $val + 1
Also you don't need semicolons after every line.

K900 said:
let val = $val + 1
Also you don't need semicolons after every line.
Click to expand...
Click to collapse
my bad, made a typing error in the first post.
I did use let val=$val+1 (now corrected in first post)
when I try it now again (to double check) it still gives the same error

Looks like it only likes it bash style.
val=$(($val+1))

mmh..
if I do it like this:
dir=/sys/class/leds
val=0
while [$val != 255]
do
echo $val > $dir/m-key-red/brightness
echo $val > $dir/m-key-green/brightness
echo $val > $dir/m-key-blue/brightness
let val=$(($val + 1 ))
done
Click to expand...
Click to collapse
Then I get this error> while not found
and if I do it like this:
dir=/sys/class/leds
val=0
while ($val != 255)
do
echo $val > $dir/m-key-red/brightness
echo $val > $dir/m-key-green/brightness
echo $val > $dir/m-key-blue/brightness
let val=$(($val + 1 ))
done
Click to expand...
Click to collapse
I get this error > Syntax error: "(" unexpected
I'm not too familiar with scripting, but usually manage to adjust stuff once it works.. but it doesn't seem to want to work

It's while < clause >; do

nope, then I get again the " while: not found " error.
an alternative would be to create an array and cycle through all numbers instead of a while construction.. or would that be too intense? + how to do that?
(i only know half of what I'm doing.. will promise not to venture further in to scripting.. just need this damn fade in/fade out to work)

nixx-X1 said:
nope, then I get again the " while: not found " error.
an alternative would be to create an array and cycle through all numbers instead of a while construction.. or would that be too intense?
Click to expand...
Click to collapse
Derp. [ square brackets not ( round ones in your clause.

dir=/sys/class/leds; val=0; while ($val != 255); do echo $val > $dir/m-key-red/brightness; echo $val > $dir/m-key-green/brightness; echo $val > $dir/m-key-blue/brightness; let val=$(($val + 1 )); done
will give me the following error:
0: not found.

nixx-X1 said:
Code:
dir=/sys/class/leds; val=0; while ($val != 255); do echo $val > $dir/m-key-red/brightness; echo $val > $dir/m-key-green/brightness; echo $val > $dir/m-key-blue/brightness; let val=$(($val + 1 )); done
will give me the following error:
0: not found.
Click to expand...
Click to collapse
your while is not correct something like this should work.
Code:
dir=/sys/class/leds
val=0
[B][COLOR="Red"]while (("$val" < "256")); do
[/COLOR][/B]
echo $val > $dir/m-key-red/brightness
echo $val > $dir/m-key-green/brightness
echo $val > $dir/m-key-blue/brightness
let val=$((val + 1 ))
done
the problem is the $val was being "called" instead of checked (thats my take on it anyway)

any chance you tested this on an Xperia U?
Just quickly tried, but got a while error again.
will check later in de afternoon double if I didn't put anything wrong in it

nixx-X1 said:
any chance you tested this on an Xperia U?
Just quickly tried, but got a while error again.
will check later in de afternoon double if I didn't put anything wrong in it
Click to expand...
Click to collapse
You need [ in place of ((
---------- Post added at 02:25 PM ---------- Previous post was at 02:20 PM ----------
Code:
led() {
echo $1 > /sys/class/leds/m-key-$2/brightness
}
val=0
while [ $val -lt 256 ]; do
led $val red
led $val green
led $val blue
val=$(($val + 1))
done
Here you go. led() is just a small helper function that works led <number> <color>

K900 said:
You need [ in place of ((
---------- Post added at 02:25 PM ---------- Previous post was at 02:20 PM ----------
Code:
led() {
echo $1 > /sys/class/leds/m-key-$2/brightness
}
val=0
while [ $val -lt 256 ]; do
led $val red
led $val green
led $val blue
val=$(($val + 1))
done
Here you go. led() is just a small helper function that works led <number> <color>
Click to expand...
Click to collapse
Thanks I thought I had it wrong.
Pvy
Sent from my LT18i using xda premium

and i'm still going nuts
seems to work everywhere but here.
when I copy & paste it, it doesn't work, when I write the it in 1 line in the terminal it neither works.
In both cases it gives the following error:
Sytax error: " do" unexpected (expecting "}")
then when I make this of it:
led() {
echo $1 > /sys/class/leds/m-key-$2/brightness
}
val=0
while [ $val -lt 256 ];
{do
led $val red
led $val green
led $val blue
val=$(($val + 1))}
done
Click to expand...
Click to collapse
it does go to the next line, but doesn't do anything or show an error
btw.. sending a simple echo does work and function as expected. (eg. echo 250 /sys/class/leds/m-key-red/brightness)

nixx-X1 said:
and i'm still going nuts
seems to work everywhere but here.
when I copy & paste it, it doesn't work, when I write the it in 1 line in the terminal it neither works.
In both cases it gives the following error:
Sytax error: " do" unexpected (expecting "}")
then when I make this of it:
it does go to the next line, but doesn't do anything or show an error
Click to expand...
Click to collapse
You have an extra { just before do. And it likely won't work in your shell if you just copy/paste.

thanks, but doesn't work either..
do you have an xperia U and tested if the middle led light will fade in if you write this?

nixx-X1 said:
thanks, but doesn't work either..
do you have an xperia U and tested if the middle led light will fade in if you write this?
Click to expand...
Click to collapse
I don't have the device on me, I only have bash.

ok, are there multiple versions of bash, could that be the reason? (still on andriod 2.3.7 btw)
if so, what version you have?

nixx-X1 said:
ok, are there multiple versions of bash, could that be the reason? (still on andriod 2.3.7 btw)
if so, what version you have?
Click to expand...
Click to collapse
Show the output when you run it please.
Also I'm pretty sure you need to run that as root.

I am running it as root (first command is "su") and the terminal emulator is a system app as well.
It's a crappy app though as it only shows one line.
this is what I typed first:
led() { echo $1 > /sys/class/leds/m-key-$2/brightness } val=0 while [ $val -lt 256 ]; do led $val red led $val green led $val blue val=$(($val + 1)) done
Click to expand...
Click to collapse
2nd line is:
led() { echo $1 > /sys/class/leds/m-key-$2/brightness } val=0 while [ $val -lt 256 ]; {do led $val red led $val green led $val blue val=$(($val + 1))} done
Click to expand...
Click to collapse
3rd line is:
led() { echo $1 > /sys/class/leds/m-key-$2/brightness } val=0 while [ $val -lt 256 ]; {do led $val red led $val green led $val blue val=$(($val + 1)) done
Click to expand...
Click to collapse

Related

Kernel Optimizations

If anyone is compiling a kernel, please unset CONFIG_UEVENT_HELPER_PATH.
It is currently set to /sbin/hotplug, which does not exist.
You might also set
echo 5 > /proc/sys/vm/laptop_mode
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
somewhere in the initramfs.
What does these settings do?
lynx2k50 said:
What does these settings do?
Click to expand...
Click to collapse
if CONFIG_UEVENT_HELPER_PATH is set, then the kernel tries to execute that helper tool every time a hotplug event occurs. Unsetting it would save a lot of forks at boot time.
Code:
echo 5 > /proc/sys/vm/laptop_mode
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
These settings delay the disk writeback, so the disk device has to wake up less often (given it goes into sleep mode ).
Ah okay so i can expect better battery life (more sleep time) and a faster booting.
Well done, thanks.
I hope some devs are going to integreate it.
OK good point to try.
Added now on my Cognition 1.07
Code:
bash-4.1# cat /etc/init.d/90laptop.sh
#!/system/bin/sh
echo 5 > /proc/sys/vm/laptop_mode
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
Code:
diff --git a/arch/arm/configs/c1_rev02_defconfig b/arch/arm/configs/c1_rev02_defconfig
index a7992c0..ccd06df 100644
--- a/arch/arm/configs/c1_rev02_defconfig
+++ b/arch/arm/configs/c1_rev02_defconfig
@@ -917,7 +917,7 @@ CONFIG_RFKILL_INPUT=y
#
# Generic Driver Options
#
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_UEVENT_HELPER_PATH=""
# CONFIG_DEVTMPFS is not set
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
Can someone pls create a update.zip or else for the cognition rom?
Or a shirt instruction.
Sry for my englisch
from my SGS running MIUI 2.3.4
If you have the CF-Root kernel installed, you can just place this in /data/local/customboot.sh
Code:
echo 5 > /proc/sys/vm/laptop_mode
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
echo -e '\000\000\000' > /proc/sys/kernel/hotplug
saturn_de said:
If you have the CF-Root kernel installed, you can just place this in /data/local/customboot.sh
Code:
echo 5 > /proc/sys/vm/laptop_mode
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
echo -e '\000\000\000' > /proc/sys/kernel/hotplug
Click to expand...
Click to collapse
the first two might help. (does Solid State internal storage need "sleep" mode?)
but depending on when the custom script is run the last line may be useless here..
Does it only work with a CF-Kernel, i've tagraks kernel, and cant find any file in data/locel .
Greetz
saturn_de said:
These settings delay the disk writeback, so the disk device has to wake up less often (given it goes into sleep mode ).
Click to expand...
Click to collapse
It doesn't go into sleep mode since it's not a spinning disk.
(Or you could look at it as always being in sleep mode when not in use - there's no spindown/spinup phase.)
So you're not gonna see any battery benefits from that.
Added into my installation on my handset. No way to test it whether it will increase stabilty nor speed, but it does tidy thinngs up.

[DISCUSSION]PerfectPeso by trettet!

Ok,this is weird.Why his topic was closed?
http://forum.xda-developers.com/showthread.php?t=1382033
I noticed that his website was blocked by SOPA.Why?The download links were mediafire links,no MU.Also Android is open source,and in his ROM it wasn't any paid app by default(i mean in system/app).What's going on?Is mediafire gonna be taken down?I noticed that it barely works.But why topic closed?
The reason is, maybe link was associate with megaupload...
Sent from my Galaxy Nexus using Tapatalk
he used mediafire links...
Marius Cristian said:
Ok,this is weird.Why his topic was closed?
http://forum.xda-developers.com/showthread.php?t=1382033
I noticed that his website was blocked by SOPA.Why?The download links were mediafire links,no MU.Also Android is open source,and in his ROM it wasn't any paid app by default(i mean in system/app).What's going on?Is mediafire gonna be taken down?I noticed that it barely works.But why topic closed?
Click to expand...
Click to collapse
i tot SOPA was shelved for the moment?
Sorry if this is OT.
But I would like to share some bugs I found while using 1.1A as I didn't upgrade to 1.4 as the links were down. Can you verify whether these are faced by any of you !
1. It takes time to wake up from the lock screen. ie even after a hard key press the screen wakes up after say 3-4 secs.
2. Data connection works with flaws. 2G/3G data seems to be buggy.
3. The notification power widget and power widget doesnt work properly. ie, even if i disable/enable Data/Orientation Lock the effect is not applied. I cant even change it in settings. Only solution is a reboot.
4. Incoming call button issues. (Solved in later versions)
Other than these, the rom is pretty stable.
umm I didn't had any of those bugs in v1.1a.actually it was one of the best version because of kernel, except few graphical bugs.anyway,look on last page/page before that of the rom,pm rosuvladut and ask him to upload rom v1.4 to 4shared or another.if he doesn't have it anymore send me a pm and I will upload v1.3 for you when I get home.i personally am lazy to upgrade to v1.4 because the changes are too insignificant.you can upgrade rom manager by yourself, instead of root browser use root explorer.about super charger I don't use it so for me v1.3=v1.4
anyone knows more about why his topic was closed? we could add other download links and that's it.
Sent from my LG-P500 using Tapatalk
I checked back in dev thread to see if any of the down links where updated. Was surprised to see no post by trettet about site being down, then noticed thread was locked. Hope all is well.
tread closed? why!
Anyone know why the notifications won't stop making noise until I view them...the sound is very annoying when it doesn't stop? I only want the notification sound once. Awesome ROM btw.
Sent from my LG-P500 using Tapatalk
i was about to flash 1.4 in my phone and then... closed thread, site down... =/
i have the link for pp1.4 posted by soberspine at mediafire:
http://www.mediafire.com/?udbvyy0j1oan0gv
but i don't have the fix (phone.apk) and gapps... can someone upload it?
also, where is trettet? do you think the thread was closed by him? or a forum admin closed it?
betoqm said:
i was about to flash 1.4 in my phone and then... closed thread, site down... =/
i have the link for pp1.4 posted by soberspine at mediafire:
http://www.mediafire.com/?udbvyy0j1oan0gv
but i don't have the fix (phone.apk) and gapps... can someone upload it?
also, where is trettet? do you think the thread was closed by him? or a forum admin closed it?
Click to expand...
Click to collapse
I asked the mod to close it down...because I'm quite discouraged of modders who actually copied my tweaks without even asking permission
EDIt:
anyways I'm tired of bug reports and fixing it and everything anyway
trettet said:
I asked the mod to close it down...because I'm quite discouraged of modders who actually copied my tweaks without even asking permission
Click to expand...
Click to collapse
talking about him!
does it mean you will not work on perfectpeso anymore?
i know have your work copied can be frustrating! but common, if i was you, i wouldn't give a sh*t... if there are modders copying your work, it means you have done a awesome job and we all recognize it!
again, we are all waiting for the next releases of perfectpeso!
betoqm said:
talking about him!
does it mean you will not work on perfectpeso anymore?
i know have your work copied can be frustrating! but common, if i was you, i wouldn't give a sh*t... if there are modders copying your work, it means you have done a awesome job and we all recognize it!
again, we are all waiting for the next releases of perfectpeso!
Click to expand...
Click to collapse
I will work on perfectpeso but won't be release on public, until Official CM7 Stable is out xD
@trettet could u please atleast give the links for the latest gapps :/
PHONEFIX.ZIP (v1.3 [ not sure ] and v1.4 [works perfectly]
Latest Gapps [works with all versions]
Aspee's Fix (works with v1.3 and v1.4)
As for the people who steal his work...you can all go to hell.
Trettet if you want I'll remove the files.I thought is nice for the people to enjoy your work.
trettet said:
I asked the mod to close it down...because I'm quite discouraged of modders who actually copied my tweaks without even asking permission
EDIt:
anyways I'm tired of bug reports and fixing it and everything anyway
Click to expand...
Click to collapse
NightlyfourE?
Sent from my LG-P500 using Tapatalk
manuvarghese said:
Sorry if this is OT.
But I would like to share some bugs I found while using 1.1A as I didn't upgrade to 1.4 as the links were down. Can you verify whether these are faced by any of you !
1. It takes time to wake up from the lock screen. ie even after a hard key press the screen wakes up after say 3-4 secs.
2. Data connection works with flaws. 2G/3G data seems to be buggy.
3. The notification power widget and power widget doesnt work properly. ie, even if i disable/enable Data/Orientation Lock the effect is not applied. I cant even change it in settings. Only solution is a reboot.
4. Incoming call button issues. (Solved in later versions)
Other than these, the rom is pretty stable.
Click to expand...
Click to collapse
Did you flash over without full wipe? Or changed patches now and then? I had these problem long ago bcos of one of above said reasons....a clean wipe has none of the above mentioned bugs .. I'm pretty sure of what I'm saying!
Sent from my LG-P500 using Tapatalk
androidusero1p500 said:
NightlyfourE?
Sent from my LG-P500 using Tapatalk
Click to expand...
Click to collapse
Why NightlyFourE I only use two tweak gov ( maxiumtweak and he removed it )+ remount in init.d
This
#!/system/bin/sh
# Governor Tweaks for Ondemand, Conservative, SmartassV2
# Ondemand
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold ]; then
echo "85" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold;
#echo "30" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/down_differential;
#echo "1" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/io_is_busy;
#echo "1" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_down_factor;
#echo "20000" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
fi;
if [ -e /sys/devices/system/cpu/cpu1/cpufreq/ondemand/up_threshold ]; then
echo "85" > /sys/devices/system/cpu/cpu1/cpufreq/ondemand/up_threshold;
#echo "30" > /sys/devices/system/cpu/cpu1/cpufreq/ondemand/down_differential;
#echo "1" > /sys/devices/system/cpu/cpu1/cpufreq/ondemand/io_is_busy;
#echo "1" > /sys/devices/system/cpu/cpu1/cpufreq/ondemand/sampling_down_factor;
#echo "20000" > /sys/devices/system/cpu/cpu1/cpufreq/ondemand/sampling_rate;
fi;
if [ -e /sys/devices/system/cpu/cpufreq/ondemand/up_threshold ]; then
echo "85" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold;
#echo "30" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential;
#echo "1" > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy;
#echo "1" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor;
#echo "20000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate;
fi;
# Conservative
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/conservative/up_threshold ]; then
echo "85" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/up_threshold;
echo "80" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/down_threshold; # 35 # 12 # 30 (higher will lead to noticable lags) # 35 # screen off: # 50 ## 35
echo "100" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/freq_step; # more aggressive ramping up (50) # screen off: # 10
fi;
if [ -e /sys/devices/system/cpu/cpu1/cpufreq/conservative/up_threshold ]; then
echo "85" > /sys/devices/system/cpu/cpu1/cpufreq/conservative/up_threshold;
echo "80" > /sys/devices/system/cpu/cpu1/cpufreq/conservative/down_threshold; # 35 # 12 # 30 (higher will lead to noticable lags) # 35 # screen off: # 50 ## 35
echo "100" > /sys/devices/system/cpu/cpu1/cpufreq/conservative/freq_step; # more aggressive ramping up (50) # screen off: # 10
fi;
if [ -e /sys/devices/system/cpu/cpufreq/conservative/up_threshold ]; then
echo "85" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold;
echo "80" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold; # 35 # 12 # 30 (higher will lead to noticable lags) # 35 # screen off: # 50 ## 35
echo "100" > /sys/devices/system/cpu/cpufreq/conservative/freq_step; # more aggressive ramping up (50) # screen off: # 10
fi;
# SmartassV2
if [ -e /sys/devices/system/cpu/cpufreq/smartass/awake_ideal_freq ]; then
echo "800000" > /sys/devices/system/cpu/cpufreq/smartass/awake_ideal_freq;
if [ "`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq`" -eq 200000 ]; then
echo "200000" > /sys/devices/system/cpu/cpufreq/smartass/sleep_ideal_freq;
else
echo "100000" > /sys/devices/system/cpu/cpufreq/smartass/sleep_ideal_freq;
fi;
echo "800000" > /sys/devices/system/cpu/cpufreq/smartass/sleep_wakeup_freq;
echo "85" > /sys/devices/system/cpu/cpufreq/smartass/max_cpu_load;
echo "80" > /sys/devices/system/cpu/cpufreq/smartass/min_cpu_load;
echo "200000" > /sys/devices/system/cpu/cpufreq/smartass/ramp_down_step;
echo "0" > /sys/devices/system/cpu/cpufreq/smartass/ramp_up_step;
fi;
Click to expand...
Click to collapse
And
#!/system/bin/sh
for k in $(busybox mount | grep relatime | cut -d " " -f3)
do
sync
busybox mount -o remount,noatime,nodiratime $k
done
for k in $(busybox mount | grep barrier | cut -d " " -f3)
do
sync
busybox mount -o remount,barrier=0 $k
done
Click to expand...
Click to collapse
And I have credit to trettet
If you think i coppy I will remove two this script
@eee I just asked cos there are no other roms except yours based on official cm.7. 2 with ics looks..
Sent from my LG-P500 using Tapatalk
androidusero1p500 said:
@eee I just asked cos there are no other roms except yours based on official cm.7. 2 with ics looks..
Sent from my LG-P500 using Tapatalk
Click to expand...
Click to collapse
I don't understand what you say

button backlight disabler

Use at your own risk, i am not responsible for anything happening to your device
What it does
This flashable zip turns your button backlight off permanantly.
it just changes your hw_config.sh file to disable backlight.
Steps
for your own safety please make a backup, in case something happens.
reboot into cwm
flash the zip
Downloads for bbl disabler.
active
lww
mini
mini pro
ray
If u want to get the light back,
active
lww
mini
mini pro
ray
in case it didn't work, edit your hw_config file found in system/etc
find this line: echo 1 > $dev/button-backlight/max_current
and set it to
Active: echo 8000 > $dev/button-backlight/max_current
lww: echo 1500 > $dev/button-backlight/max_current
mini pro: echo 500 > $dev/button-backlight/max_current
ray: echo 50 > $dev/button-backlight/max_current
for mini find these two lines
echo 1 > $dev/button-backlight-rgb1/max_current
echo 1 > $dev/button-backlight-rgb2/max_current
change to
echo 8000 > $dev/button-backlight-rgb1/max_current
echo 8000 > $dev/button-backlight-rgb2/max_current
okay
I have an easier way
put it in init.d
Code:
echo 1 > /sys/class/leds/button-backlight-rgb1/max_current;
echo 1 > /sys/class/leds/button-backlight-rgb2/max_current;
Re: Testers for button backlight disabler
Gustavo RD78 said:
okay
I have an easier way
put it in init.d
Code:
echo 1 > /sys/class/leds/button-backlight-rgb1/max_current;
echo 1 > /sys/class/leds/button-backlight-rgb2/max_current;
Click to expand...
Click to collapse
Add it at the last or change something??
Edit: I get a feeling u use a mini(others dont have 2 button backlights rgb1 and rgb2)
Don't forget to hit thanks
Add the lines in a script that you already have or add this script :good:
Note: this is not a flash zip
Gustavo RD78 said:
Add the lines in a script that you already have or add this script :good:
Note: this is not a flash zip
Click to expand...
Click to collapse
thanks for the info and the file
but..i still think mine's easier, just a simple flash when you flash a new rom
could you please try it and confirm it works?
thanks

[Tutorial]How to Disable Button Backlight

While Browsing the Neo\Neo V forum
i noticed several posts
asking about how to disable button backlight
specially in JB 4.2.2 threads
so i decided to create a tutorial to help you people solve this problem
PREREQUISITE
1. A Phone :laugh:
2. Root Explorer
3. Brain(most essential) :silly:
PROCEDURE
1. Start your phone
2. Open Root Explorer
3. Goto Root\system\etc
4. Open hw_config.sh
5. Scroll Down to the Last line and add these lines after it.(in the line after last line)
6. # Button Backlight Configuration
7. echo 1 > $dev/button-backlight/max_current
8. Save the file
9. Restart your phone
10. Enjoy
Hit Thanks
Nice guide, you can do this without Root Explorer too, using the default CM File Manager with enabled root access
mikeioannina said:
Nice guide, you can do this without Root Explorer too, using the default CM File Manager with enabled root access
Click to expand...
Click to collapse
by root explorer i mean any file explorer with root access
not the root explorer app
avinashrocks1990 said:
by root explorer i mean any file explorer with root access
not the root explorer app
Click to expand...
Click to collapse
Ok then. I added a link to this guide in the first post in my cm10.1 thread.
avinashrocks1990 said:
While Browsing the Neo\Neo V forum
i noticed several posts
asking about how to disable button backlight
specially in JB 4.2.2 threads
so i decided to create a tutorial to help you people solve this problem
PREREQUISITE
1. A Phone :laugh:
2. Root Explorer
3. Brain(most essential) :silly:
PROCEDURE
1. Start your phone
2. Open Root Explorer
3. Goto Root\system\etc
4. Open hw_config.sh
5. Scroll Down to the Last line and add these lines after it.(in the line after last line)
6. # Button Backlight Configuration
7. echo 1 > $dev/button-backlight/max_current
8. Save the file
9. Restart your phone
10. Enjoy
Hit Thanks
Click to expand...
Click to collapse
now the hw.confiq.sh changed look and tell me how can you change the values that you said
see
default
at neo v
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds
echo 900 > $dev/button-backlight-rgb1/max_current #Max current in uA
echo 900 > $dev/button-backlight-rgb2/max_current #Max current in uA
besttt said:
now the hw.confiq.sh changed look and tell me how can you change the values that you said
see
default
at neo v
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds
echo 900 > $dev/button-backlight-rgb1/max_current #Max current in uA
echo 900 > $dev/button-backlight-rgb2/max_current #Max current in uA
Click to expand...
Click to collapse
no need to edit those lines
just add the lines i have said in the end
and it will work
@besttt
logcat google talk fc
avinashrocks1990 said:
While Browsing the Neo\Neo V forum
i noticed several posts
asking about how to disable button backlight
specially in JB 4.2.2 threads
so i decided to create a tutorial to help you people solve this problem
PREREQUISITE
1. A Phone :laugh:
2. Root Explorer
3. Brain(most essential) :silly:
PROCEDURE
1. Start your phone
2. Open Root Explorer
3. Goto Root\system\etc
4. Open hw_config.sh
5. Scroll Down to the Last line and add these lines after it.(in the line after last line)
6. # Button Backlight Configuration
7. echo 1 > $dev/button-backlight/max_current
8. Save the file
9. Restart your phone
10. Enjoy
Hit Thanks
Click to expand...
Click to collapse
Sent from my MT11i using xda premium
Nice but its already excist in Xperia Arc forum by @jader13254
:::[ Pandemic Quote.:: Im The Godfather Of St Octane TF Packs !!
Press Thanks If You Like My Work/Advice !!!
Pandemic said:
Nice but its already excist in Xperia Arc forum by @jader13254
:::[ Pandemic Quote.:: Im The Godfather Of St Octane TF Packs !!
Press Thanks If You Like My Work/Advice !!!
Click to expand...
Click to collapse
It's okay I didn't knew that
And it was necessary because the forum was flooded by post asking about how to disable the button backlight
Sent from my Xperia Neo V using Tapatalk 2
But it does not work on GB.
mlotek01 said:
But it does not work on GB.
Click to expand...
Click to collapse
post your hw_config.sh
# Audio jack configuration
dev=/sys/devices/platform/simple_remote.0
echo 0,201,1600 > $dev/accessory_min_vals # default = 0,200,1600
echo 200,1599 > $dev/accessory_max_vals # default = 200,1600
echo 0,100,280,500,770 > $dev/button_min_vals # default = 0,100,300,600,700
echo 99,199,470,769,5000 > $dev/button_max_vals # default = 99,199,399,699,5000
echo 512 > $dev/btn_trig_period_freq # Button Period Freq(Hz) default = 512
echo 16 > $dev/btn_trig_period_time # Button Period Time(cycle) default = 16
echo 512 > $dev/btn_trig_hyst_freq # Button Hysteresis Freq(Hz) default = 512
echo 16 > $dev/btn_trig_hyst_time # Button Hysteresis Time(Cycle) default = 16
echo 500 > $dev/btn_trig_level # default = 500
# Proximity sensor configuration
dev=/sys/bus/i2c/devices/0-0054/
val_cycle=0
val_nburst=1
val_freq=0
val_threshold=4
val_filter=0
nv_param_loader 60240 prox_cal
val_calibrated=$?
case $val_calibrated in
1)
nv_param_loader 60240 threshold
val_threshold=$?
nv_param_loader 60240 rfilter
val_filter=$?
;;
esac
echo $val_cycle > $dev/cycle # Duration Cycle. Valid range is 0 - 3.
echo $val_nburst > $dev/nburst # Number of pulses in burst. Valid range is 0 - 15.
echo $val_freq > $dev/freq # Burst frequency. Valid range is 0 - 3.
echo $val_threshold > $dev/threshold # sensor threshold. Valid range is 0 - 15 (0.12V - 0.87V)
echo $val_filter > $dev/filter # RFilter. Valid range is 0 - 3.
# LMU AS3676 Configuration
dev=/sys/devices/i2c-0/0-0040/leds
echo 1,40,255,35,35,1,100 > $dev/lcd-backlight/als/curve # ALS curve display BL [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 2,85,0,128,128,200,201 > $dev/button-backlight-rgb1/als/curve # ALS curve key LED 1 [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 2,85,0,128,128,200,201 > $dev/button-backlight-rgb2/als/curve # ALS curve key LED 2 [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 3,100,255,21,21,10,100 > $dev/red/als/curve # ALS curve RGB(red) [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 3,100,255,21,21,10,100 > $dev/green/als/curve # ALS curve RGB(green) [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 3,100,255,21,21,10,100 > $dev/blue/als/curve # ALS curve RGB(blue) [grp],[Y0],[Y3],[K1],[K2],[X1],[X2]
echo 1,2,2,0 > $dev/lcd-backlight/als/params #[gain],[filter_up],[filter_down],[offset]
echo 1 > $dev/lcd-backlight/als/enable #Sensor on/off. 1 = on, reg 90h
echo 1 > $dev/button-backlight-rgb1/als/enable #Sensor on/off. 1 = on, reg 90h
echo 1 > $dev/button-backlight-rgb2/als/enable #Sensor on/off. 1 = on, reg 90h
echo 1 > $dev/red/als/enable #Sensor on/off. 1 = on, reg 90h
echo 1 > $dev/green/als/enable #Sensor on/off. 1 = on, reg 90h
echo 1 > $dev/blue/als/enable #Sensor on/off. 1 = on, reg 90h
echo 900 > $dev/button-backlight-rgb1/max_current #Max current in uA
echo 900 > $dev/button-backlight-rgb2/max_current #Max current in uA
# TI BQ275xx firmware loader
bq275xx_fwloader
echo 1 > $dev/button-backlight/max_current
It's better to attach text page instead huge post..
The lamps do not light up when buttons are pressed and I have removed the line in the file. Thank you for helping me
Envoyé depuis mon Super Arc à flèche nommé Arc S.
on CM10 works perfect.
@avinash thanks for reply in my pm..is it possible that keylight could be kernel related? Because when I use the old pacman 4.2.2 kernel by shardul, the keylight is gone. When I used the pacman nAa-03 based kernel inside rom zip the keylight is present..I already PM you the download link for pacman 4.2.2 nightly build for 2011 Xperia..maybe you can test the rom for your device, its working good..
For me Linus Torvalds is the greatest man on earth
bitoyz13 said:
@avinash thanks for reply in my pm..is it possible that keylight could be kernel related? Because when I use the old pacman 4.2.2 kernel by shardul, the keylight is gone. When I used the pacman nAa-03 based kernel inside rom zip the keylight is present..I already PM you the download link for pacman 4.2.2 nightly build for 2011 Xperia..maybe you can test the rom for your device, its working good..
For me Linus Torvalds is the greatest man on earth
Click to expand...
Click to collapse
no bro
keylight has nothing to do with kernel
they are two separate builds that you are using although they are based on similar source code
the hw_config.sh isn't modified in the link that you pm me
just edit the hw_config.sh your problem will be solved
it's not a big deal
The operation failed
Gaks said:
The operation failed
Click to expand...
Click to collapse
Its your file explorer's problem
Sent from my Xperia Neo V using Tapatalk 4 Beta

Run shell screencap pixel color help plz

I've been reading and searching for days and have yet to find or maybe just implement correctly, a sure way to check a coordinate for a certain pixel color and then use that variable in a task.
Phone: Galaxy note 3
Android: 5.0
Using tasker. I found this snippet for using in tasker. I'm either not doing something right or this code is not working.
Variable set: set %devicewidth to 1080 (This is the smaller value of your screen resolution)
Variable set (check Do Maths): set %offset to %par1 * %devicewidth
su -cn u:r:system_app:s0
screencap /sdcard/scr.dump;
let offset=%offset;
stringZ=$(dd if='/sdcard/scr.dump' bs=4 count=1 skip=$offset 2>/sdcard/result.txt| hexdump); red=$(echo $stringZ | cut -d' ' -f2 | tail -c3);
I'm getting a red dot when I debug right in front of this line below this sentence
green=$(echo $stringZ | cut -d' ' -f3 | tail -c3);
blue=$(echo $stringZ | cut -d' ' -f4 | tail -c3); rgb="$red$green$blue";
echo $rgb;
Flash (for debugging purposes): %final
If %final eq %par2
Return 1
else
Return 0
end if
Then I setup another task to perform this task. Maybe I'm setting variables wrong or something. But it's constantly stuck on the loop to find my color on the screen.
I'm hoping someone has some better links to instructions for how to actually use this step by step. Or know if something is wrong.
I just can't seem to figure out how to use it or the variable correctly. Here's code I'm trying to run it with.
Color Check Test (2)
A1: Launch App [ App:Mage and Minions Data: Exclude From Recent Appsff Always Start New Copyff ]
A2: Wait [ MS:0 Seconds:3 Minutes:0 Hours:0 Days:0 ]
A3: Perform Task [ NameixelColorCheck Priority:%priority Parameter 1 (%par1):1050 + 150 Parameter 2 (%par2):#FFB74D Return Value Variable:%box1check Stopff ]
A4: If [ %box1check eq 1 ]
A5: Wait [ MS:0 Seconds:3 Minutes:0 Hours:0 Days:0 ]
A6: Run Shell [ Command:input swipe 1020 170 1540 170 1000 Timeout (Seconds):0 Use Rootn Store Output In: Store Errors In: Store Result In: ]
A7: Else
A8: Goto [ Type:Action Number Number:3 Label: ]
A9: End If
Please and thank you for any advice. This snippet of code is making pull my hair out. Once I figure this out, then I can set up some variables for each item box so it can check to see quality of item and whether or not to keep or sell.

Categories

Resources