Notices


Reply
Thread Tools
Posts: 176 | Thanked: 59 times | Joined on Mar 2010
#101
I'm trying to create a 2G/3G toggle widget.

When I copy and paste the (rather long) 2g3g.sh script from here

http://wiki.maemo.org/Desktop_Comman...cripts#2G.2F3G

into the Command field of the AddCmd settings, all that is entered is the first line of the script

*!/bin/sh
 
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#102
Originally Posted by SallyJane View Post
I'm trying to create a 2G/3G toggle widget.

When I copy and paste the (rather long) 2g3g.sh script from here

http://wiki.maemo.org/Desktop_Comman...cripts#2G.2F3G

into the Command field of the AddCmd settings, all that is entered is the first line of the script

*!/bin/sh
You cannot paste it directly into QBW.
You need to connect to X-Terminal for that and then...:
Code:
 ~ $
cd /home/user
cat > 2g3g.sh
<here you paste the script>
#!/bin/sh
if [ `dbus-send --system --type=method_call --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_selected_radio_access_technology | awk '/b/ {print $2}'` -eq 1 ]; then
dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:2
else
dbus-send --system --type=method_call --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.set_selected_radio_access_technology byte:1
fi

<then you press CTRL-D and you get the prompt again>

~ $ chmod 755 2g3g.sh
Now you can "AddCmd": /home/user/2g3g.sh

... and see what happens.
__________________
Have a look at Queen BeeCon Widget (WIKI) Customizable and flexible widget-based multi-instance monitoring, alerting and interactive tool for the N900
Please provide comments and feedback for having QBW supported and enhanced further - (DONATE) - v1.3.3devel / v1.3.3testing / v1.3.3extras
 

The Following User Says Thank You to No!No!No!Yes! For This Useful Post:
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#103
We are now in... Extras Repository eventually!!! Yayyyyy!!!
__________________
Have a look at Queen BeeCon Widget (WIKI) Customizable and flexible widget-based multi-instance monitoring, alerting and interactive tool for the N900
Please provide comments and feedback for having QBW supported and enhanced further - (DONATE) - v1.3.3devel / v1.3.3testing / v1.3.3extras

Last edited by No!No!No!Yes!; 2010-04-27 at 00:08.
 

The Following 2 Users Say Thank You to No!No!No!Yes! For This Useful Post:
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#104
N900 Mini Monitor... preview. Still testing output formatting and minor issues!

__________________
Have a look at Queen BeeCon Widget (WIKI) Customizable and flexible widget-based multi-instance monitoring, alerting and interactive tool for the N900
Please provide comments and feedback for having QBW supported and enhanced further - (DONATE) - v1.3.3devel / v1.3.3testing / v1.3.3extras

Last edited by No!No!No!Yes!; 2010-04-27 at 06:24.
 

The Following User Says Thank You to No!No!No!Yes! For This Useful Post:
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#105
This is in very early stages of development so it doesn't deserve its proper thread...
It's just a proof of concept for handling persistency of configuration data across multiple command executions... Furthermore PR1.2 is supposed to bring changes to counters position so... let's wait a little bit more for final version.

Customize Queen BeeCon Widget (>=v0.1.4) to display:
GPRS Compact Data Monitor

The Beecon will show plenty of Data Plan information and statistics, plus changes background according to data plan capacity consumption.






Code:
[queen-beecon-header]
version=1,000000
checksum=5739874
[queen-beecon-exported-instance]
widgetType=0
operationalStatus=0
hideCanvas=true
snippetBgRGB=0
beecon_lt0_ImgZoom=0
beecon_lt0_BgRGB=2
beecon_lt0_ImgFilename=queen-beecon-syserr.png
beecon_eq0_ImgZoom=0
beecon_eq0_BgRGB=3
beecon_eq0_ImgFilename=gprsmon-green.png
beecon_eq1_ImgZoom=0
beecon_eq1_BgRGB=4
beecon_eq1_ImgFilename=gprsmon-yellow.png
beecon_ge2_ImgZoom=0
beecon_ge2_BgRGB=5
beecon_ge2_ImgFilename=gprsmon-red.png
beecon_idxge2_ImgZoom=0
beecon_idxge2_BgRGB=11
beecon_idxge2_ImgFilename=queen-beecon-index.png
widWidth=175
widHeight=110
instanceTitle=Gprs Compact Data Monitor
instanceCmd=SD=20100414;RP=2M;U=0;D=0;T=600;red=95;yellow=90;echo `gconftool-2 --get /system/osso/connectivity/network_type/GPRS/gprs_reset_time` `gconftool-2 --get /system/osso/connectivity/network_type/GPRS/gprs_tx_bytes` `gconftool-2 --get /system/osso/connectivity/network_type/GPRS/gprs_rx_bytes` | awk -v r=$red -v y=$yellow -v U=$U -v D=$D -v T=$T -v SD=$SD -v RP=$RP -v N=$(date -d "`echo $SD | cut -c 5-6` `echo $SD | cut -c 7-8` `echo $SD | cut -c 1-4`" +%s) -v CD=`date "+%Y%m%d"` '{x=0;M=1048576;SDd=substr(SD,7,2);SDm=substr(SD,5,2);SDy=substr(SD,1,4);i=substr(RP,1,length(RP)-1);u=$2/M;if(U>0)Uu=($2/M)/U*100;d=$3/M;if(D>0)Dd=($3/M)/D*100;t=($2+$3)/M;if(T>0)Tt=($2+$3)/M/T*100;Xm=nXm(SDd,SDm,SDy,i,RP,N);LR=strftime("%Y%m%d@%H%M",$1);if(Uu>=y||Dd>=y||Tt>=y)x++;if(Uu>=r||Dd>=r||Tt>=r)x++;if(x>2)x=2;printf("SD:%s RP:%3s\\nNR:%s\\nU%4dM(%4dM-%3d%%)\\nD%4dM(%4dM-%3d%%)\\nT%4dM(%4dM-%3d%%)\\nLR:%s\\n",SD,RP,Xm,u,U,Uu,d,D,Dd,t,T,Tt,LR);exit x;}function Dy(d,m,y){m=(m+9)%12;y=int(y-m/10);return 365*y+y/4-y/100+y/400+(m*306+5)/10+(d-1);}function nXm(d,m,y,i,RP,N){split("31,28,31,30,31,30,31,31,30,31,30,31",dm,",");CDd=substr(CD,7,2);CDm=substr(CD,5,2);CDy=substr(CD,1,4);if(index(RP,"D")>0){s=strftime("%Y%m%d",N+86400*(i-1));od=substr(s,7,2);om=substr(s,5,2);oy=substr(s,1,4);} else {om=(m+i)%12;oy=y+int((m+i)/12);od=d;while(od>dm[om])od--;if (((oy%4==0&&oy%100!=0)||(oy%400==0))&&om==2&&d>28)then od++;}return sprintf("%4d%02d%02d D:%4d",oy,om,od,-1*int(Dy(od,om,oy)-Dy(CDd,CDm,CDy)));}'
cmdImgFilename=gprsmon.png
cmdImgZoom=0
cmdFgRGB=1
cmdVisibilityPosition=0
cmdImgVisibilityPosition=5
cmdJustify=0
cmdFontName=3
cmdFontSize=12
resImgFilename=queen-beecon-resimg.png
resImgZoom=0
resFgRGB=0
resVisibilityPosition=5
resImgVisibilityPosition=5
resJustify=0
resFontName=14
resFontSize=11
updOnStartup=false
updOnClick=true
updOnDesktop=false
delayIndex=4
updNeworkPolicy=0
Change specific parameters (explained inside the image above) at the very beginning of the command line...
Attached Files
File Type: zip gprsmon-images.zip (29.4 KB, 139 views)
__________________
Have a look at Queen BeeCon Widget (WIKI) Customizable and flexible widget-based multi-instance monitoring, alerting and interactive tool for the N900
Please provide comments and feedback for having QBW supported and enhanced further - (DONATE) - v1.3.3devel / v1.3.3testing / v1.3.3extras

Last edited by No!No!No!Yes!; 2010-05-05 at 20:30.
 

The Following 4 Users Say Thank You to No!No!No!Yes! For This Useful Post:
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#106
Current developments are now focused on providing Inter Process Communication among QBW instances and with other Applications.

This feature is under design/development as I would like to release the much complete and customizable IPC mechanism possible, like for example:
  • Give impulse to a Beecon for content update
  • Give impulse to a Beecon for layout update
  • Give other beecons one-shot alternative scripts to execute
  • Remotely change QBW settings
  • Retrieve other beecon's last executed commands exit status
  • Provide to non graphical programs and daemons a suitable interface for displaying information on precustomized beecons on screen (for example Dbus Scripts for displaying events on the system/session DBUS like cell IDs changes, available WLANs and the like)
I encourage you to suggest possible enhancements or wishlists in this area.

There are infinite possibilities ... just stay tuned!!!
__________________
Have a look at Queen BeeCon Widget (WIKI) Customizable and flexible widget-based multi-instance monitoring, alerting and interactive tool for the N900
Please provide comments and feedback for having QBW supported and enhanced further - (DONATE) - v1.3.3devel / v1.3.3testing / v1.3.3extras

Last edited by No!No!No!Yes!; 2010-05-14 at 19:31.
 

The Following 4 Users Say Thank You to No!No!No!Yes! For This Useful Post:
Posts: 1,751 | Thanked: 844 times | Joined on Feb 2010 @ Sweden
#107
I am sure this is written somewhere but can't get it to work.

echo `date +"<span size=\\"15\\"><b>%A, %-Y-%m-%-d - Vecka %W</b></span>"`

What am i doing wrong? Also i am trying to make a button to switch my kernel-setting to use limits. In this case i don't want the "root shell enabled" output. Just want the bg to show. Is it possible to get output not to show?
 
Posts: 150 | Thanked: 80 times | Joined on Dec 2009
#108
Originally Posted by AlMehdi View Post
Is it possible to get output not to show?
Under Command Result Settings choose the position to be hidden, then the output won't show up.
 

The Following User Says Thank You to Sash For This Useful Post:
Posts: 1,751 | Thanked: 844 times | Joined on Feb 2010 @ Sweden
#109
Originally Posted by Sash View Post
Under Command Result Settings choose the position to be hidden, then the output won't show up.
Ahh.. great! thanks.
 
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#110
Originally Posted by AlMehdi View Post
I am sure this is written somewhere but can't get it to work.

echo `date +"<span size=\\"15\\"><b>%A, %-Y-%m-%-d - Vecka %W</b></span>"`

What am i doing wrong? Also i am trying to make a button to switch my kernel-setting to use limits. In this case i don't want the "root shell enabled" output. Just want the bg to show. Is it possible to get output not to show?
Ciao,
this will work ...
Code:
echo "<span font=\"15\"><b>`date +"%A, %-Y-%m-%-d - Vecka %W"`</b></span>"
BTW: why bothering using Pango Markup Tags when you can stick to native QBW formatting settings from here:
__________________
Have a look at Queen BeeCon Widget (WIKI) Customizable and flexible widget-based multi-instance monitoring, alerting and interactive tool for the N900
Please provide comments and feedback for having QBW supported and enhanced further - (DONATE) - v1.3.3devel / v1.3.3testing / v1.3.3extras
 

The Following User Says Thank You to No!No!No!Yes! For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 21:39.