maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread (https://talk.maemo.org/showthread.php?t=45388)

seanmcken 2012-07-11 15:13

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
another help needed. plzz tell how to add chromium-browser of easy debian in queen beecon as a shortcut on desktop??

wittyheart 2012-08-11 04:43

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
it is possible to delete a QBW by writing command in x-term?

Sandeep 2012-10-19 07:17

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Is there any command to get the Playlist popup which we see when pressed on the Mediaplayer widget ??

vi_ 2012-10-19 08:49

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by seanmcken (Post 1236074)
another help needed. plzz tell how to add chromium-browser of easy debian in queen beecon as a shortcut on desktop??

You do not need a QBW for that, you need to make a .desktop file and it will appear in the list of programs.


Quote:

Originally Posted by wittyheart (Post 1250293)
it is possible to delete a QBW by writing command in x-term?

Yes, look at the QBW wiki page. Check out the DBUS controls.


Quote:

Originally Posted by Sandeep (Post 1282445)
Is there any command to get the Playlist popup which we see when pressed on the Mediaplayer widget ??

Not really, working with the current mafw-playlist from xterm is a *****.

AKEEL 2012-11-04 07:44

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Hi,
Someone tell me the QBW command for put mobile in "OFFLINE MODE" and "NORMAL MODE"

Thanks.

talou 2012-11-05 12:23

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Hi,
using linux kernel power user and overclocking feature, I got the maxCPU widget that helps to change the max CPU limit on the fly.

But I needed to know the real usage of the cpu. Thanks to QBW this is th CPU bogomips command :

Code:

printf "%0.f bgmps\n" `cat /proc/cpuinfo |grep Bogo |awk -F": " '{print $2}'`

Tiran 2012-11-25 08:16

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
I am sorry for bad English!
At me such problem: After reboot N900 became inactive all QBW.

http://imageplay.net/img/tya22293919...125_114791.png
http://imageplay.net/img/tya22293917...125_114337.png

How it is possible to activate again all QBW in my system???

JonWW 2012-11-25 13:21

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by Tiran (Post 1298096)
I am sorry for bad English!
At me such problem: After reboot N900 became inactive all QBW.

How it is possible to activate again all QBW in my system???

Looks like /home/user/.queen_beecon file has been corrupted or deleted, hence the reason why each QBW has been reset to its default settings, I hope you backed it up!

Tiran 2012-11-25 16:37

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
@JonWW, thanks for the help! Has anew made all QBW and now has copied and has saved a file .queen_beecon.

JonWW 2012-11-25 18:27

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by Tiran (Post 1298284)
Has anew made all QBW and now has copied and has saved a file .queen_beecon.

Not sure what you mean here :confused:

Have you made all new QBW? If you have, make a backup copy of /home/user/.queen_beecon

shawnjefferson 2012-11-25 19:43

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Is there any way to setup a QBW so that when you click on it on the dekstop, it will open a webpage? The QBW already runs a script that display some information, but I'd like to be able to click on the widget and launch a website too.

sixwheeledbeast 2012-11-25 19:49

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by shawnjefferson (Post 1298336)
I'd like to be able to click on the widget and launch a website too.

Code:

run-standalone.sh dbus-send --system --type=method_call --dest=com.nokia.osso_browser /com/nokia/osso_browser/request com.nokia.osso_browser.load_url string:"duckduckgo.com"

shawnjefferson 2012-11-25 19:52

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Hi,

Sorry my question may not have been too clear. There is already a script associated with this QBW that goes to a website, gets some information and displays a graphic based on what's returned. I ALSO want to be able to click on that graphic and launch a website (to see why the graphic is displayed...) That doesn't seem an easy task as there is only one "command" you can run with a QBW, and it runs the same one on @Desktop, interval and @click.

I suppose I could write the script so that it would launch this dbus command, but how to detect it was clicked on instead of launched by QBW @interval or @desktop for instance?

Tiran 2012-11-25 20:01

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by JonWW (Post 1298317)
Have you made all new QBW?

Yes.

Quote:

Originally Posted by JonWW (Post 1298317)
If you have, make a backup copy of /home/user/.queen_beecon

After creation new QBWs, I have copied a file .queen_beecon on external memory card.

mariosalhab 2012-12-19 12:57

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by No!No!No!Yes! (Post 823289)
http://i52.tinypic.com/au81ut.jpg
http://i51.tinypic.com/213ly69.jpg

Here's another way to have a "2 States Button" which is "ON" on widget/system startup and toggles at every press.
It uses $QBW_CURRENT_RESULTS_TEXT substitution parameter.
  1. Save attached images to usual QBW images directories
  2. Import Beecon
    Code:

    [queen-beecon-header]
    version=1.000000
    checksum=2980534
    [queen-beecon-exported-instance]
    widgetType=0
    widgetVisible=1
    operationalStatus=0
    hideCanvas=true
    snippetBgRGB=0
    snippetExtBgRGB=#000000000000
    beecon_lt0_ImgZoom=0
    beecon_lt0_BgRGB=2
    beecon_lt0_ExtBgRGB=#808080808080
    beecon_lt0_ImgFilename=queen-beecon-syserr.png
    beecon_eq0_ImgZoom=0
    beecon_eq0_BgRGB=3
    beecon_eq0_ExtBgRGB=#00005cfc0000
    beecon_eq0_ImgFilename=off-button.png
    beecon_eq1_ImgZoom=0
    beecon_eq1_BgRGB=4
    beecon_eq1_ExtBgRGB=#ffffffff0000
    beecon_eq1_ImgFilename=on-button.png
    beecon_ge2_ImgZoom=0
    beecon_ge2_BgRGB=5
    beecon_ge2_ExtBgRGB=#ffff00000000
    beecon_ge2_ImgFilename=queen-beecon-apperr.png
    beecon_idxge2_ImgZoom=0
    beecon_idxge2_BgRGB=11
    beecon_idxge2_ExtBgRGB=#0000ffffffff
    beecon_idxge2_ImgFilename=queen-beecon-index.png
    widWidth=128
    widHeight=145
    instanceTitle=2 States Button
    instanceCmd=if [ "$QBW_EXEC_REASON" == "QBW_STARTUP_UPDATE" ];then echo "ON";exit 1;fi;if [ "$QBW_CURRENT_RESULTS_TEXT" == "ON" ];then echo "OFF";exit 0; else echo "ON";exit 1;fi;
    rememberMe=
    cmdImgFilename=queen-beecon.png
    cmdImgZoom=0
    cmdFgRGB=1
    cmdExtFgRGB=#ffffffffffff
    cmdTextAngle=0
    cmdVisibilityPosition=2
    cmdImgVisibilityPosition=0
    cmdJustify=0
    cmdExtFont=Nokia Sans 10
    cmdFontName=3
    cmdFontSize=12
    resImgFilename=queen-beecon-resimg.png
    resImgZoom=0
    resFgRGB=1
    resExtFgRGB=#ffff00000000
    resTextAngle=0
    resVisibilityPosition=0
    resImgVisibilityPosition=8
    resJustify=0
    resExtFont=Nokia Sans bold italic 18
    resFontName=2
    resFontSize=12
    updOnStartup=true
    updOnClick=true
    updOnDesktop=false
    delayIndex=0
    customIntervalSecs=0
    updNeworkPolicy=0
    updOnDBUS=0
    updOnDBUSBus=0
    updOnDBUSMatchRule=
    progressAnimationBasename=queen-beecon-progress
    progressAnimationFrames=0
    progressAnimationTimer=4
    progressAnimationPos=4
    updOnSight=false
    cmdImgAngle=0
    resImgAngle=0
    hideClickCanvas=true
    progressAnimationAtClickXY=false

  3. After import, edit command and add switch on/off instructions as better specified here:
    PHP Code:

    if [ "$QBW_EXEC_REASON== "QBW_STARTUP_UPDATE" ]; then
    #    add here switch on instructions
        
    echo "ON";
        exit 
    1;
    fi;

    if [ 
    "$QBW_CURRENT_RESULTS_TEXT== "ON" ]; then
    #    add here switch off instructions
        
    echo "OFF";
        exit 
    0;
    else
    #    add here switch on instructions
        
    echo "ON";
        exit 
    1;
    fi



Hello,

I am trying to make a widget on/off button for a VPN connection.. everything needed to make this connection is in a script file placed in /bin directory named vpn.. so whenever I write in the terminal vpn I am connected to the vpn network. When I use this command you put above in the part of your code "# add here switch on instructions" i put vpn which is my script but nothing happens.. can u help me please?

sixwheeledbeast 2012-12-19 13:11

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by mariosalhab (Post 1306049)
When I use this command you put above in the part of your code "# add here switch on instructions" i put vpn which is my script but nothing happens.. can u help me please?

We need to see your script.
You have removed the comment hash from the beginning?

mariosalhab 2012-12-19 16:28

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by sixwheeledbeast (Post 1306056)
We need to see your script.
You have removed the comment hash from the beginning?

of course i removed the hash... here is my script

clear
pppd call vpnconnection
sleep 3
route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.0.120 ppp0
route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.0.120 ppp0
echo "VPN Connected - Press CTRL+C to disconnect"
ping 192.168.0.120>/dev/null

this script can be called from the terminal just by writing 'vpn'

No!No!No!Yes! 2013-01-08 21:22

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by shawnjefferson (Post 1298342)
Hi,

Sorry my question may not have been too clear. There is already a script associated with this QBW that goes to a website, gets some information and displays a graphic based on what's returned. I ALSO want to be able to click on that graphic and launch a website (to see why the graphic is displayed...) That doesn't seem an easy task as there is only one "command" you can run with a QBW, and it runs the same one on @Desktop, interval and @click.

I suppose I could write the script so that it would launch this dbus command, but how to detect it was clicked on instead of launched by QBW @interval or @desktop for instance?

See HERE if $QBW_EXEC_REASON Parameter Substitution at Command/Script Runtime helps...
There is a whole bunch of conditions that can be tested inside your script:
Code:

QBW_TIMER_UPDATE
QBW_STARTUP_UPDATE
QBW_SETTINGS_SAVE_RUN
QBW_TEST_DRIVE
QBW_WAKEUP_CLICK
QBW_CLICK
QBW_DESKTOP_SWITCH
QBW_CONNECTION_EVENT
QBW_DBUS_SET_PARAM_UPDATE
QBW_DBUS_WAKEUP
QBW_DBUS_UPDATE_CONTENT
QBW_DBUS_EXEC
QBW_DBUS_MONITOR
QBW_ORIENTATION_MONITOR
QBW_LOCATION_MONITOR_FIX


No!No!No!Yes! 2013-04-08 02:34

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Thanks, Techie.
Appreciate!

No!No!No!Yes! 2013-04-21 01:50

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Thanks, Leslie/Ruben.
Appreciate!

low 2013-05-25 17:29

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
1 Attachment(s)
Hi guys,

today I sat down to build something from QBW...
basically it's a text clock telling the time, which also says the time via espeak when clicked and opens the clock app when double clicked.
I am using a font from the Resident Evil theme, and espeak obviously:

Code:

[queen-beecon.desktop-2]
widgetType=1
widgetVisible=1
operationalStatus=0
hideCanvas=true
hideClickCanvas=true
snippetBgRGB=0
snippetExtBgRGB=#000000000000
beecon_lt0_ImgZoom=0
beecon_lt0_BgRGB=2
beecon_lt0_ExtBgRGB=#808080808080
beecon_lt0_ImgFilename=queen-beecon-syserr.png
beecon_eq0_ImgZoom=0
beecon_eq0_BgRGB=3
beecon_eq0_ExtBgRGB=#0000ffff0000
beecon_eq0_ImgFilename=queen-beecon-appok.png
beecon_eq1_ImgZoom=0
beecon_eq1_BgRGB=4
beecon_eq1_ExtBgRGB=#ffffffff0000
beecon_eq1_ImgFilename=queen-beecon-appwrn.png
beecon_ge2_ImgZoom=0
beecon_ge2_BgRGB=5
beecon_ge2_ExtBgRGB=#ffff00000000
beecon_ge2_ImgFilename=queen-beecon-apperr.png
beecon_idxge2_ImgZoom=0
beecon_idxge2_BgRGB=11
beecon_idxge2_ExtBgRGB=#0000ffffffff
beecon_idxge2_ImgFilename=queen-beecon-index.png
widWidth=420.69480519480516
widHeight=200.252427184466
instanceTitle=textclock
instanceCmd=/usr/local/bin/textclock $QBW_EXEC_REASON $QBW_CLICKS_COUNT
rememberMe=
cmdImgFilename=
cmdImgAngle=0
cmdImgZoom=1
cmdFgRGB=1
cmdExtFgRGB=#ffffffffffff
cmdTextAngle=0
cmdVisibilityPosition=0
cmdImgVisibilityPosition=0
cmdJustify=0
cmdExtFont=Nokia Sans bold italic 12
cmdFontName=3
cmdFontSize=12
resImgFilename=
resImgAngle=0
resImgZoom=0
resFgRGB=1
resExtFgRGB=#000000000000
resTextAngle=0
resVisibilityPosition=5
resImgVisibilityPosition=0
resJustify=2
resExtFont=Resident Evil 60
resFontName=16
resFontSize=10
resWrapLongLines=true
progressAnimationFrames=0
progressAnimationTimer=4
progressAnimationPos=4
progressAnimationAtClickXY=false
progressAnimationBasename=
updOnStartup=true
updOnClick=true
multiClick=true
updOnDesktop=true
updOnSight=true
updOnOrientation=false
delayIndex=9
customIntervalSecs=10
updNeworkPolicy=0
GPSsettings=0
updOnDBUS=0
updOnDBUSBus=0
updOnDBUSMatchRule=

And the shellscript to feed the clock:

Code:

if [ "$1" == "QBW_CLICK" ] && [ $2 -eq 2 ]
then
dbus-send --type=method_call --dest=com.nokia.HildonDesktop.AppMgr /com/nokia/HildonDesktop/AppMgr com.nokia.HildonDesktop.AppMgr.LaunchApplication string:"worldclock"
fi
        h=`date +%-I`
        m=`date +%-M`


k="one:two:three:four:five:six:seven:eight:nine:ten:eleven:twelve:thirteen:fourteen:quarter:sixteen:seventeen:eighteen:nineteen:twenty"
l="x:twenty:thirty:forty:fifty"


if [ $m -lt 21 ] && [ $m -gt 0 ] || [ $m -eq 30 ]
then

        if [ $m -eq 30 ]
        then
                mw="half"       
               
        else
                mw=`echo $k|cut -f$m -d:`
        fi
        hw=`echo $k|cut -f$h -d:`
        o1=$mw
        o2="past"
        o3=$hw
elif [ $m -gt 49 ] || [ $m -eq 45 ] || [ $m -eq 40 ]
then
       
        if [ $h -eq 12 ]
        then
                hw="one"
        else
                h=$(($h+1))
                hw=`echo $k|cut -f$h -d:`
        fi
        m=$((60-$m))
        mw=`echo $k|cut -f$m -d:`
        o1=$mw
        o2="to"
        o3=$hw
elif [ $m -eq 0 ]
then

        o1=`echo $k|cut -f$h -d:`
        o2="o'clock"
        o3="sharp"

else

        hw=`echo $k|cut -f$h -d:`
        m1=`echo $m|cut -c1`
        m2=`echo $m|cut -c2`
               

        o1=$hw
        o2=`echo $l|cut -f$m1 -d:`
        o3=`echo $k|cut -f$m2 -d:`
fi
if [ $2 -eq 1 ]
then
        sil=`dbus-send --print-reply --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.get_profile|tail -1|cut -f2 -d\"`
        if [ "$sil" == "silent" ]
        then
        dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteInfoprint string:"Sorry I'm supposed to be silent."
        else
                espeak "$o1 $o2 $o3"
        fi
fi
        echo "$o1<span size=\"1\"> </span><span face=\"NewTimes\" size=\"80000\" weight=\"normal\">$o2</span><span size=\"1\"> </span>$o3"

I hope you enjoy it as much as I do, and of course if you would like to point me to an improvement feel free to drop me a line.

Kind regards,

Sarah

Alecsandru 2013-08-11 04:36

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
has anyone succesfully created a media player widget with queen beacon?

som3a 2014-02-03 15:43

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
hi all ,, i have two questions ,, hope i can find the answers as quick as possible :)
the first one is :
what the things i need to learn/know to make a nice looking QBW?
and if you pleased tell me where to learn them ! consider me as a complete noob
the second one is :
is it possible to password lock a desktop using the QBWs!!

sorry for my missed up english !! :/

No!No!No!Yes! 2014-02-03 15:56

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
WIKI and Examples can be a good start.

som3a 2014-02-03 17:22

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
greattttt :) ,, i will be digging there :)

and about the password lock thing !!!

Whispering Weasel 2014-04-20 21:26

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
I want to create an icon on the normal desktop for email with an unread email counter and when clicked it should open Claws-mail. The Gmail script from the wiki doesn't seem to work (anymore?)

I have managed to get something with curl in the console using the command from here 9adding -k option but have no idea how and where to fit this as script in qbw.
I think it can be done in a script like mentioned this. but exactly how to do this I don't know
Is this possible? any idea's/help ? :)

No!No!No!Yes! 2014-04-21 20:16

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by Whispering Weasel (Post 1422123)
I want to create an icon on the normal desktop for email with an unread email counter and when clicked it should open Claws-mail. The Gmail script from the wiki doesn't seem to work (anymore?)

I have managed to get something with curl in the console using the command from here 9adding -k option but have no idea how and where to fit this as script in qbw.
I think it can be done in a script like mentioned this. but exactly how to do this I don't know
Is this possible? any idea's/help ? :)

PHP Code:

Nokia-N900-51-1:~# wget -t 1 -T 3 -q -O - 'https://nonono.yes:nononoyes@mail.google.com/mail/feed/atom' --no-check-certificate | awk 'BEGIN{m=2}/<fullcount>.+<\/fullcount>/{gsub(/<[^>]*>/,"",$0);print $1 " New";if($1>0)m=1;else m=0}END{exit m}'
New
Nokia-N900-51-1:~

This is working for me... or you can use any equivalent with curl.

If you have configured the beecon to run both on timer and on click, in your script you might check $QBW_EXEC_REASON for the following strings

if QBW_TIMER_UPDATE then poll gmail (with the command above)
if QBW_CLICK then run Claws-mail per example in here

Whispering Weasel 2014-04-24 10:45

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Thanks, it is almost working now, I had issues with wget due to @ in the password, solved it..
Now it is only displaying the mailbox_empty.png but it does update the mailcount, simply pasting the command in the script doesn't let it return the correct state?
My programming skills are ehm.. at noob level :) so i got this far:

PHP Code:

if [ "$QBW_EXEC_REASON== "QBW_TIMER_UPDATE" ]; then
# get the new mail info
wget -t 1 -T 3 ---user=myusername --password=myp@ssword -'https://mail.google.com/mail/feed/atom' --no-check-certificate awk 'BEGIN{m=2}/<fullcount>.+<\/fullcount>/{gsub(/<[^>]*>/,"",$0);print $1 " New";if($1>0)m=1;else m=0}END{exit m}'
fi;

if [ 
"$QBW_EXEC_REASON== "QBW_CLICK" ]; then
# start claws-mail 
/usr/bin/dbus-send --dest=com.nokia.HildonDesktop.AppMgr /com/nokia/HildonDesktop/AppMgr com.nokia.HildonDesktop.AppMgr.LaunchApplication string:claws-mail
fi



No!No!No!Yes! 2014-04-25 19:03

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Quote:

Originally Posted by Whispering Weasel (Post 1422564)
Thanks, it is almost working now, I had issues with wget due to @ in the password, solved it..
Now it is only displaying the mailbox_empty.png but it does update the mailcount, simply pasting the command in the script doesn't let it return the correct state?
My programming skills are ehm.. at noob level :) so i got this far:

PHP Code:

if [ "$QBW_EXEC_REASON== "QBW_TIMER_UPDATE" ]; then
# get the new mail info
wget -t 1 -T 3 ---user=myusername --password=myp@ssword -'https://mail.google.com/mail/feed/atom' --no-check-certificate awk 'BEGIN{m=2}/<fullcount>.+<\/fullcount>/{gsub(/<[^>]*>/,"",$0);print $1 " New";if($1>0)m=1;else m=0}END{exit m}'
fi;

if [ 
"$QBW_EXEC_REASON== "QBW_CLICK" ]; then
# start claws-mail 
/usr/bin/dbus-send --dest=com.nokia.HildonDesktop.AppMgr /com/nokia/HildonDesktop/AppMgr com.nokia.HildonDesktop.AppMgr.LaunchApplication string:claws-mail
fi



We have a couple of issues here:
First "if block" is missing a piece because awk statement "if($1>0)m=1;else m=0}END{exit m}" just returns the exit code to the calling script... I'd add an explicit exit statement before the fi;

Second "if block" is missing a further check and an exit status; behavior here would be that for every click the beecon will launch the mail program but return a 0 exit and whatever output the dbus-send is issuing to stdout (= always mailbox_empty.png and possibly "" number of messages)

See below for a possible improvement:
PHP Code:

if [ "$QBW_EXEC_REASON== "QBW_TIMER_UPDATE" ]; then
# get the new mail info
wget -t 1 -T 3 ---user=myusername --password=myp@ssword -'https://mail.google.com/mail/feed/atom' --no-check-certificate awk 'BEGIN{m=2}/<fullcount>.+<\/fullcount>/{gsub(/<[^>]*>/,"",$0);print $1 " New";if($1>0)m=1;else m=0}END{exit m}'
exit $?
fi;

if [ 
"$QBW_EXEC_REASON== "QBW_CLICK" ]; then
# start claws-mail 
/usr/bin/dbus-send --dest=com.nokia.HildonDesktop.AppMgr /com/nokia/HildonDesktop/AppMgr com.nokia.HildonDesktop.AppMgr.LaunchApplication string:claws-mail
# get the new mail info
wget -t 1 -T 3 ---user=myusername --password=myp@ssword -'https://mail.google.com/mail/feed/atom' --no-check-certificate awk 'BEGIN{m=2}/<fullcount>.+<\/fullcount>/{gsub(/<[^>]*>/,"",$0);print $1 " New";if($1>0)m=1;else m=0}END{exit m}'
exit $?
fi

Further, you might want to manage possible error conditions from the wget command inside your awk 1-liner

Whispering Weasel 2014-04-27 20:15

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
1 Attachment(s)
hmm, I'm not sure about the mailcheck when clicked, it is supposed to just open claws so just an exit 0 would be ok here I think? (displaying mailbox_empty.png until the next timed update).
The problem I'm having is it always seems returns 0 thus displaying mailbox_empty.png although I do get the new mail count.
(mailbox_full.png does work when i change the exit 0 to exit 1)

sebar 2016-01-21 22:16

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Hey guys!

What's up here - everyone switched to android or what? ;)
Let's see if someone's still alive here...
Also from me KUDOS for this piece of coding for the Maemo Community.
I searched these pages like a mad man, but didn't find an explanation that helped me.

I created a "2 States Switch" that even does what I want (Brightness high and low). But for more sensitive applications like "reboot" or so, I'd like it to be triggered through multi click. I know I have to activate "@MultiClick" and use "$QBW_CLICKS_COUNT". But I just cannot get it to work! Can someone please add the neccessary code to the original BEECON one?
http://talk.maemo.org/showthread.php...289#post823289

Still love this NOT-A-PHONE!

sixwheeledbeast 2016-01-21 22:39

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
You you just need to create a standard beecon with @Clicked on, not a 2 state one?

sebar 2016-01-21 22:50

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Thanks for your reply!
Yes - for a reboot you're right. I picked a bad example.
I'm running several processes that i would like to start and stop safely - not accidentally. One of them is a periodic e-mail being send containg system information. Another one is transmission-daemon.

sebar 2016-01-26 11:34

Re: [Announce] Queen BeeCon Widget: Super powerful and customizable Widget Generation Engine - Official Thread
 
Still lacking the knowledge how to use multi click as a confirmation I've started using the dialogue box provided by zenity. This dialogue pops up at the bottom of the screen and lets you push a button as confirmation. This makes things a little more complicated, though.

1. Write a script "askstart" that contains the zenity command for starting a process.
2. Write a script "askstop" containing the zenity command for stopping the process.
3. Use askstart and askstop as start/stop commands in the beecon.

Essential: The two scripts must exit with an output like "Running" or "Not Running" so the beecon can display these states. For - and that really sucks - I was not able to make the on/off image show up reliably. It just kept changing, no matter how you answered the zenith dialogue.

Should anyone be interested, I'll gladly provide the code that's working for me.

Cheers!


All times are GMT. The time now is 19:15.

vBulletin® Version 3.8.8