|
|
11-13-2010
, 04:31 AM
|
|
Posts: 429 |
Thanked: 216 times |
Joined on Apr 2010
@ Dubai
|
#92
|
[0-9]|1[0-9])color="red";; [2-3][0-9])color="purple";; [4-5][0-9])color="yellow";; [6-7][0-9])color="bblue";; *)color="white";;
|
|
11-13-2010
, 01:52 PM
|
|
Posts: 68 |
Thanked: 19 times |
Joined on Jan 2010
@ Chicago
|
#93
|
|
|
11-13-2010
, 02:29 PM
|
|
Posts: 429 |
Thanked: 216 times |
Joined on Apr 2010
@ Dubai
|
#94
|
|
|
11-13-2010
, 06:01 PM
|
|
Posts: 35 |
Thanked: 4 times |
Joined on Jul 2008
@ São Paulo-Brasil
|
#96
|
|
|
11-13-2010
, 06:06 PM
|
|
Posts: 429 |
Thanked: 216 times |
Joined on Apr 2010
@ Dubai
|
#97
|
|
|
11-15-2010
, 05:08 PM
|
|
Posts: 303 |
Thanked: 549 times |
Joined on Jan 2010
@ Romania
|
#98
|
there is something i dont get...
what does this mean?
Code:[0-9]|1[0-9])color="red";; [2-3][0-9])color="purple";; [4-5][0-9])color="yellow";; [6-7][0-9])color="bblue";; *)color="white";;
s1="com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_" s3="activate string:Pattern" case `lshal|grep percentage|tr -s " "|cut -d " " -f 4|sort -n|head -1` in [0-9]|1*)color=red;; [2-3]*)color=purple;; [4-5]*)color=yellow;; [6-7]*)color=bblue;; *)color=white;;esac; for somecolor in white bblue yellow purple red; do [ "$color" = "$somecolor" ] && s2="" || s2="de" todo="$s1$s2$s3$somecolor" dbus-send --system --type=method_call --dest=$todo done exit
| The Following User Says Thank You to blue_led For This Useful Post: | ||
|
|
11-16-2010
, 04:10 AM
|
|
Posts: 429 |
Thanked: 216 times |
Joined on Apr 2010
@ Dubai
|
#99
|

![]() |
| Tags |
| bakuur, battery, indicator, notification |
| Thread Tools | Search this Thread |
|
add word Pattern
convert all variables to strings
corrected IF line
colored lines must be one line
#! /bin/bash sudo gainroot #set variables for current bar level and previous bar level curlvl=`lshal|grep percentage|tr -s " "|cut -d " " -f 4|sort -n|head -1` echo $curlvl #set pattern to current battery level poff="com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_deactivate string:Pattern" pon="com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_led_pattern_activate string:Pattern" case ${curlvl} in [0-9]|1[0-9])color="red";; [2-3][0-9])color="purple";; [4-5][0-9])color="yellow";; [6-7][0-9])color="bblue";; *)color="white";; esac for somecolor in "white" "bblue" "yellow" "purple" "red"; do finaldestination="$poff$somecolor" [ "$color" = "$somecolor" ] && finaldestination="$pon$somecolor" dbus-send --system --type=method_call --dest=$finaldestination done exitLast edited by blue_led; 11-12-2010 at 07:28 PM.