|
2013-12-22
, 16:17
|
|
Posts: 152 |
Thanked: 91 times |
Joined on Mar 2013
@ Russia Saratov
|
#132
|
#!/bin/bash status=$(hal-get-property --udi /org/freedesktop/Hal/devices/bme --key maemo.charger.connection_status) echo $status > /home/user/MyDocs/status.log echo "no" > /home/user/MyDocs/level.log echo "no" > /home/user/MyDocs/level1.log echo "no" > /home/user/MyDocs/level2.log echo "no" > /home/user/MyDocs/level3.log echo "no" > /home/user/MyDocs/level4.log echo "no" > /home/user/MyDocs/level5.log #Создаем первоначальный лог source /tmp/session_bus_address.user while true do # #############################charge on/off################################### status=$(hal-get-property --udi /org/freedesktop/Hal/devices/bme --key maemo.charger.connection_status) log=$(cat /home/user/MyDocs/status.log) if [[ "$status" == "$log" ]]; then : else if [[ "$status" == "connected" ]]; then qdbus com.mikeasoft.rockwatch /rockwatch showSMS "N9" "Charge Connected!" echo $status > /home/user/MyDocs/status.log else qdbus com.mikeasoft.rockwatch /rockwatch showSMS "N9" "Charge disconnected!" echo $status > /home/user/MyDocs/status.log fi fi # ########################## charge level 70%################################## level=$(hal-get-property --udi /org/freedesktop/Hal/devices/bme --key battery.charge_level.percentage) levellog=$(cat /home/user/MyDocs/level.log) if [[ "$level" == "70" ]]; then if [[ "$levellog" == "ok" ]]; then : else qdbus com.mikeasoft.rockwatch /rockwatch showSMS "N9" "Charge level 70%" echo "ok" > /home/user/MyDocs/level.log fi else echo "no" > /home/user/MyDocs/level.log fi # ########################## charge level 50%################################## level1=$(hal-get-property --udi /org/freedesktop/Hal/devices/bme --key battery.charge_level.percentage) levellog1=$(cat /home/user/MyDocs/level1.log) if [[ "$level1" == "50" ]]; then if [[ "$levellog1" == "ok" ]]; then : else qdbus com.mikeasoft.rockwatch /rockwatch showSMS "N9" "Charge level 50%" echo "ok" > /home/user/MyDocs/level1.log fi else echo "no" > /home/user/MyDocs/level1.log fi # ########################## charge level 30%################################## # charge level 30% level2=$(hal-get-property --udi /org/freedesktop/Hal/devices/bme --key battery.charge_level.percentage) levellog2=$(cat /home/user/MyDocs/level1.log) if [[ "$level2" == "30" ]]; then if [[ "$levellog2" == "ok" ]]; then : else qdbus com.mikeasoft.rockwatch /rockwatch showSMS "N9" "Charge level 30%" echo "ok" > /home/user/MyDocs/level2.log fi else echo "no" > /home/user/MyDocs/level2.log fi # ########################## charge level 20%################################## level3=$(hal-get-property --udi /org/freedesktop/Hal/devices/bme --key battery.charge_level.percentage) levellog3=$(cat /home/user/MyDocs/level1.log) if [[ "$level3" == "20" ]]; then if [[ "$levellog2" == "ok" ]]; then : else qdbus com.mikeasoft.rockwatch /rockwatch showSMS "N9" "Charge level 20%" echo "ok" > /home/user/MyDocs/level3.log fi else echo "no" > /home/user/MyDocs/level3.log fi # ########################## charge level 10%################################## level4=$(hal-get-property --udi /org/freedesktop/Hal/devices/bme --key battery.charge_level.percentage) levellog4=$(cat /home/user/MyDocs/level1.log) if [[ "$level4" == "10" ]]; then if [[ "$levellog2" == "ok" ]]; then : else qdbus com.mikeasoft.rockwatch /rockwatch showSMS "N9" "Charge level 10%" echo "ok" > /home/user/MyDocs/level4.log fi else echo "no" > /home/user/MyDocs/level4.log fi # ########################## charge level 5%################################## level5=$(hal-get-property --udi /org/freedesktop/Hal/devices/bme --key battery.charge_level.percentage) levellog5=$(cat /home/user/MyDocs/level1.log) if [[ "$level5" == "5" ]]; then if [[ "$levellog2" == "ok" ]]; then : else qdbus com.mikeasoft.rockwatch /rockwatch showSMS "N9" "Charge level 5% LOW POWER!!!" echo "ok" > /home/user/MyDocs/level5.log fi else echo "no" > /home/user/MyDocs/level5.log fi sleep 1 done
|
2013-12-22
, 21:45
|
|
Posts: 152 |
Thanked: 91 times |
Joined on Mar 2013
@ Russia Saratov
|
#133
|
#!/bin/bash echo "-" > /home/user/MyDocs/wifi_log.log source /tmp/session_bus_address.user while true do name_wifi=$(qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkName org.maemo.contextkit.Property.Get | sed q) status_wifi=$(qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkState org.maemo.contextkit.Property.Get | sed q) wifi_log=$(cat /home/user/MyDocs/wifi_log.log) lan=$(qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkType org.maemo.contextkit.Property.Get | sed q) if [[ "$status_wifi" == "connected" ]]; then if [[ "$status_wifi" == "$wifi_log" ]]; then : else qdbus com.mikeasoft.rockwatch /rockwatch showSMS "N9" "$lan ""$name_wifi ""$status_wifi" echo $status_wifi > /home/user/MyDocs/wifi_log.log echo $name_wifi > /home/user/MyDocs/wifi_log1.log echo $lan > /home/user/MyDocs/wifi_lan.log fi else if [[ "$status_wifi" == "disconnected" ]]; then if [[ "$status_wifi" == "$wifi_log" ]]; then : else wf_name=$(cat /home/user/MyDocs/wifi_log1.log) lan_name=$(cat /home/user/MyDocs/wifi_lan.log) qdbus com.mikeasoft.rockwatch /rockwatch showSMS "N9" "$lan_name ""$wf_name ""$status_wifi" echo $status_wifi > /home/user/MyDocs/wifi_log.log fi fi fi sleep 1 done
|
2013-12-22
, 21:53
|
|
Posts: 152 |
Thanked: 91 times |
Joined on Mar 2013
@ Russia Saratov
|
#134
|
The Following User Says Thank You to Alexxxl For This Useful Post: | ||
|
2013-12-23
, 10:21
|
|
Posts: 152 |
Thanked: 91 times |
Joined on Mar 2013
@ Russia Saratov
|
#135
|
#!/bin/bash source /tmp/session_bus_address.user while true do echo "$(qdbus com.meecast.data /com/meecast/data com.meecast.data.GetCurrentWeather)" > /usr/share/meecast.txt a=$(sed '1!d' /usr/share/meecast.txt) b=$(sed '2!d' /usr/share/meecast.txt) c=$(sed '6!d' /usr/share/meecast.txt) d=$(sed '8!d' /usr/share/meecast.txt) # echo $a $b $c $d qdbus com.mikeasoft.rockwatch /rockwatch showSMS "Meecast" "$a , ""$b В°C, ""$c, ""$d" sleep 7200 # 2 hours done
|
2013-12-23
, 11:36
|
|
Posts: 152 |
Thanked: 91 times |
Joined on Mar 2013
@ Russia Saratov
|
#136
|
#!/bin/bash echo "-" > /home/user/MyDocs/id_log.log source /tmp/session_bus_address.user while true do call=$(qdbus com.nokia.CallUi.Context /com/nokia/CallUi/CallStatusBar org.maemo.contextkit.Property.Get | sed '1!d') id=$(qdbus com.nokia.CallUi.Context /com/nokia/CallUi/ActiveCall org.maemo.contextkit.Property.Get | sed '6!d') id_log=$(cat /home/user/MyDocs/id_log.log) if [[ "$id" == "$id_log" ]]; then : else #if [[ "$call" == "true" ]]; then if [[ "$id" != "$id_log" ]]; then name=$(qdbus com.nokia.CallUi.Context /com/nokia/CallUi/ActiveCall org.maemo.contextkit.Property.Get | grep displayName | cut -d ' ' -f2) qdbus com.mikeasoft.rockwatch /rockwatch showSMS "INCOMING CALL " "$name" sleep 1 qdbus com.mikeasoft.rockwatch /rockwatch showSMS "INCOMING CALL " "$name" sleep 2 qdbus com.mikeasoft.rockwatch /rockwatch showSMS "$name" "INCOMING CALL " sleep 0.3 qdbus com.mikeasoft.rockwatch /rockwatch showSMS "$name" "INCOMING CALL " echo $id > /home/user/MyDocs/id_log.log fi fi sleep 1 done
#!/bin/sh echo "-" > /home/user/MyDocs/id_log.log source /tmp/session_bus_address.user while true do call=$(qdbus com.nokia.CallUi.Context /com/nokia/CallUi/CallStatusBar org.maemo.contextkit.Property.Get | sed '1!d') id=$(qdbus com.nokia.CallUi.Context /com/nokia/CallUi/ActiveCall org.maemo.contextkit.Property.Get | sed '6!d') id_log=$(cat /home/user/MyDocs/id_log.log) if [[ "$id" == "$id_log" ]]; then : else if [[ "$call" == "true" ]]; then if [[ "$id" != "$id_log" ]]; then name=$(qdbus com.nokia.CallUi.Context /com/nokia/CallUi/ActiveCall org.maemo.contextkit.Property.Get | grep displayName | cut -d ' ' -f2) qdbus com.mikeasoft.rockwatch /rockwatch showSMS "INCOMING CALL " "$name" sleep 1 qdbus com.mikeasoft.rockwatch /rockwatch showSMS "INCOMING CALL " "$name" sleep 2 qdbus com.mikeasoft.rockwatch /rockwatch showSMS "$name" "INCOMING CALL " echo $id > /home/user/MyDocs/id_log.log else : fi else : fi fi sleep 1 done
|
2013-12-23
, 17:45
|
|
Posts: 861 |
Thanked: 734 times |
Joined on Jan 2008
@ Nomadic
|
#137
|
The Following User Says Thank You to ARJWright For This Useful Post: | ||
|
2013-12-24
, 04:44
|
|
Posts: 266 |
Thanked: 979 times |
Joined on Jan 2010
@ London
|
#138
|
The Following 5 Users Say Thank You to Elleo For This Useful Post: | ||
|
2013-12-24
, 06:58
|
|
Posts: 1,552 |
Thanked: 3,108 times |
Joined on Jun 2012
@ Russia, 96
|
#139
|
Meecast
Code:#!/bin/bash source /tmp/session_bus_address.user while true do echo "$(qdbus com.meecast.data /com/meecast/data com.meecast.data.GetCurrentWeather)" > /usr/share/meecast.txt a=$(sed '1!d' /usr/share/meecast.txt) b=$(sed '2!d' /usr/share/meecast.txt) c=$(sed '6!d' /usr/share/meecast.txt) d=$(sed '8!d' /usr/share/meecast.txt) # echo $a $b $c $d qdbus com.mikeasoft.rockwatch /rockwatch showSMS "Meecast" "$a , ""$b В°C, ""$c, ""$d" sleep 7200 # 2 hours done
The Following User Says Thank You to Ancelad For This Useful Post: | ||
|
2013-12-24
, 07:45
|
|
Posts: 152 |
Thanked: 91 times |
Joined on Mar 2013
@ Russia Saratov
|
#140
|
Tags |
nokia n9, smart watch |
|
but does not show the fact of the call at the moment