coredumb
|
2011-07-27
, 13:11
|
|
Posts: 92 |
Thanked: 74 times |
Joined on Nov 2008
@ Indonesia
|
#1351
|
|
2011-07-27
, 13:15
|
Posts: 1,680 |
Thanked: 3,685 times |
Joined on Jan 2011
|
#1352
|
vi_, i only have a little knowledge on dbus. after doing some obvservation, i found that dbus-scripts only grep 4 argument when the device going standby, which is sender, destination, interface (com.nokia.mce.signal), and member (system_inactivity_ind). but i couldn't find the way to get the status of system_inactivity_ind, the 'true/false' value.
so, to let my script know what is the current status of system_inactivity_ind, i use a file as indicator.
if the indicator file exist, then the device is in standby mode, and vice versa.
this is my script:
the problem is, the script couldn't know the current state when the device is rebooted/restartedCode:#!/bin/bash INACTIVE_IND=inactive.indicator if [ -e $INACTIVE_IND ] ; then echo 100 > /proc/sys/vm/vfs_cache_pressure rm $INACTIVE_IND else echo 10 > /proc/sys/vm/vfs_cache_pressure touch $INACTIVE_IND fi
do you have any advice, how to get the system_inactivity_ind boolean value using bash script?
|
2011-07-27
, 13:17
|
Posts: 1,680 |
Thanked: 3,685 times |
Joined on Jan 2011
|
#1353
|
update on my script, on automatically change the value of vfs_cache_pressure based on system_inactivity_ind status
Code:#!/bin/bash DBUS_SEND=/usr/bin/dbus-send AWK=/usr/bin/awk INACTIVE=$($DBUS_SEND --system --type=method_call --dest=com.nokia.mce --print-reply=literal /com/nokia/mce/request com.nokia.mce.request.get_inactivity_status | $AWK '{ print $2 }') if [ "$INACTIVE" == "false" ] ; then echo 100 > /proc/sys/vm/vfs_cache_pressure else echo 10 > /proc/sys/vm/vfs_cache_pressure fi
/opt/scripts/some_script.sh * * com.nokia.mce.signal system_inactivity_ind
#!/bin/sh ###This **** checks to see if phone is REALLY asleep, sometimes inactive signal appears at a funny time. brightness=$(cat /sys/class/backlight/acx565akm/brightness) keyboard=$(cat /sys/devices/platform/gpio-switch/slide/state) if [ "$brightness" == "0" ]; then if [ "$keyboard" == "closed" ]; then #do some stuff #Do some other stuff fi fi
The Following User Says Thank You to vi_ For This Useful Post: | ||
|
2011-07-27
, 13:57
|
Posts: 856 |
Thanked: 1,681 times |
Joined on Apr 2010
@ Aleppo ,Syria
|
#1354
|
The Following 6 Users Say Thank You to karam For This Useful Post: | ||
|
2011-07-27
, 14:00
|
Posts: 458 |
Thanked: 136 times |
Joined on Jul 2010
@ Holland
|
#1355
|
|
2011-07-27
, 14:02
|
Posts: 856 |
Thanked: 1,681 times |
Joined on Apr 2010
@ Aleppo ,Syria
|
#1356
|
|
2011-07-27
, 14:11
|
Posts: 1,680 |
Thanked: 3,685 times |
Joined on Jan 2011
|
#1357
|
guys after testing the dbus-script
i had a better battery life
standby : 4 days (max)
continues usage : if depends on the kind if usage
ex : webos games (sounds video touchscreen keyboard)
will last for about 4 - 5 hours (max)
ex : IM programs like pidgin and others
will last on continues usage about 9 - 12 hours
other tiny programs will last about 15 hours of continues usage of them
i think this is a great result
an iphone can't have like that one
but be aware i that i have every auto update program is disabled
wifi search interval is disabled too
i will post instructions and how to soon when i have a free time
PS: I HAVE NOTICED SOME THING
when i use N900 heavy usage the battery drains about 2 - 4 % each 10 minutes
but when i leave it standby about 15 minutes the battery value increases
ex : from 40% to 50% sometimes 55%
i think if is predicting feature of N900
it calculates the remaining time of heavy and standby usage (just maybe)
/etc/network/if-up.d/50_wifiscripts
#!/bin/sh essid=$(iwgetid -s) if [ "$essid" == "qwerty12" ]; then iwconfig wlan0 txpower 7 echo $essid elif [ "$essid" == "work" ]; then iwconfig wlan0 txpower 3 fi
/etc/network/if-down.d/50_wifiscripts
#!/bin/sh iwconfig wlan0 txpower 20
|
2011-07-27
, 14:37
|
|
Posts: 939 |
Thanked: 366 times |
Joined on Dec 2010
@ U.K.
|
#1358
|
|
2011-07-27
, 15:26
|
|
Posts: 92 |
Thanked: 74 times |
Joined on Nov 2008
@ Indonesia
|
#1359
|
I don't really understand your question. The dbus-scripts rule provided earlier ONLY matches to system inactive. I know it works because I have tested it relentlessly.
Where did you read dbus-scripts only matches 4 'arguments'?
================================= Arg 1: :1.11 Arg 2: null Arg 3: com.nokia.mce.signal Arg 4: system_inactivity_ind Script /home/user/bin/cpu_normal.sh matches
|
2011-07-27
, 15:38
|
|
Posts: 92 |
Thanked: 74 times |
Joined on Nov 2008
@ Indonesia
|
#1360
|
WTF? o0 are you out of your god-dammed mind?
You use dbus-scripts in order to avoid polling things. i.e. dbus-scripts waits for somthing, then runs a script.
You don't poll dbus to get the current state of something in order to run a script.
This rule WILL run the script '/opt/scripts/some_script.sh' when the system inactivity signal is on dbus.
Code:/opt/scripts/some_script.sh * * com.nokia.mce.signal system_inactivity_ind
/usr/sbin/dbus-send --system --type=method_call --dest=com.nokia.mce --print-reply=literal /com/nokia/mce/request com.nokia.mce.request.get_inactivity_status
Tags |
autobrick, awesome-script, do no install, f***epitaph, install it now, perfect_ n900, script-a-brick, very safe |
Thread Tools | |
|