View Single Post
coderus's Avatar
Posts: 6,436 | Thanked: 12,701 times | Joined on Nov 2011 @ Ängelholm, Sweden
#770
@Win7Mac this style of coding more intelligent:
Code:
#!/bin/sh

state=$(qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkState org.maemo.contextkit.Property.Get | sed q)
wlan='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-wlan-cyan.png>>'
umts='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-3g-yellow.png>>'
egprs='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-25g-yellow.png>>'
gprs='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-gsm-red.png>>'
hspa='<</usr/share/themes/blanco/meegotouch/icons/icon-s-status-35g-green.png>>'
if [[ $state == "connected" ]]; then
    NT=$(develsh -c "qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkType org.maemo.contextkit.Property.Get | sed q")
    NN=$(qdbus --system com.nokia.icd2.context /org/maemo/contextkit/Internet/NetworkName org.maemo.contextkit.Property.Get | sed q)
    if [[ $NT == "WLAN" ]]; then
        echo -n "{{cyan}}$NN $wlan"
    else
        DT=$(develsh -c "qdbus --system com.nokia.csd.CSNet /com/nokia/csd/csnet com.nokia.csd.CSNet.RadioAccess.DataTechnology")
        case $DT in
        "GPRS") echo -n "{{yellow}}$NN $gprs" ;;
        "EGPRS") echo -n "{{yellow}}$NN $egprs" ;;
        "UMTS") echo -n "{{yellow}}$NN $umts" ;;
        "HSPA") echo -n "{{yellow}}$NN $hspa" ;;
        esac
    fi
fi
__________________
Telegram | Openrepos | GitHub | Revolut donations

Last edited by coderus; 2013-03-31 at 05:15.
 

The Following 2 Users Say Thank You to coderus For This Useful Post: