View Single Post
No!No!No!Yes!'s Avatar
Posts: 700 | Thanked: 846 times | Joined on Nov 2009
#568
Originally Posted by BluesLee View Post
@3xNo1xYes: i used the new introduced variables to realize
my face2face widget. clicking on the eyes, mouth etc of
the attached wallpaper launches a corresponding application.
but i have some problems, see below.

here is the exported qbw::
Code:
[queen-beecon-header]
version=1.000000
checksum=2682652
[queen-beecon-exported-instance]
widgetType=0
widgetVisible=0
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=#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=780.59270516717334
widHeight=410.12307692307689
instanceTitle=face2face
instanceCmd=echo $QBW_CLICK_X > /home/user/bin/qbw_clickpos.txt; echo $QBW_CLICK_Y >> /home/user/bin/qbw_clickpos.txt; /home/user/bin/qbw_face2face.sh
rememberMe=
cmdImgFilename=
cmdImgAngle=0
cmdImgZoom=0
cmdFgRGB=1
cmdExtFgRGB=#ffffffffffff
cmdTextAngle=0
cmdVisibilityPosition=2
cmdImgVisibilityPosition=5
cmdJustify=0
cmdExtFont=Nokia Sans bold italic 12
cmdFontName=3
cmdFontSize=12
resImgFilename=
resImgAngle=1
resImgZoom=0
resFgRGB=1
resExtFgRGB=#ffffffffffff
resTextAngle=0
resVisibilityPosition=3
resImgVisibilityPosition=9
resJustify=0
resExtFont=Nokia Sans bold 16
resFontName=2
resFontSize=12
progressAnimationFrames=0
progressAnimationTimer=0
progressAnimationPos=4
progressAnimationBasename=
updOnStartup=false
updOnClick=true
updOnDesktop=false
updOnSight=false
delayIndex=0
customIntervalSecs=0
updNeworkPolicy=0
updOnDBUS=0
updOnDBUSBus=0
updOnDBUSMatchRule=
method: i write $QBW_CLICK_X and $QBW_CLICK_Y to a
file /home/user/bin/qbw_clickpos.txt and reread those values
from the script qbw_face2face.sh. if the click is within a
given rectangle the corresponding app is launched.

Code:
#!/bin/bash

PATH=/home/user/bin:/usr/bin/:$PATH; 

declare -i CLICK_X=`head -1 /home/user/bin/qbw_clickpos.txt`;
declare -i CLICK_Y=`tail -1 /home/user/bin/qbw_clickpos.txt`; 
# Front
APP1=(osso-xterm 118 87); 
# Right Eye
APP2=(conboy 53 118); 
# Left Eye
APP3=(evopedia 194 120);  
# Mouth
APP4=(launch_mediaplayer 117 249);
# Headphone 
APP5=(qbw_hsc.sh 320 120);
# Nose 
APP6=(qbw_monit.sh 120 184); 

APP_COUNT=6;

R=20;

check_betrag(){
  if [ $1 -le $2 ]; then
    BETRAG=$(( $2 - $1 ));
  else
    BETRAG=$(( $1 - $2 ));
  fi
}

check_rectangle(){
  X=$2; Y=$3;
  check_betrag $2 $CLICK_X;
  if [ $BETRAG -le $R ]; then  
    check_betrag $3 $CLICK_Y;
    if [ $BETRAG -le $R ]; then   
      exec $( eval echo \${APP${i}[0]} ) \&;
      #eval echo \${APP${i}[0]} ;
      #echo $CLICK_X $CLICK_Y;
    fi
  fi;
};

for (( i=1; i<=${APP_COUNT}; i++ )); do
  check_rectangle $i `echo $(( APP${i}[1] ))` `echo $(( APP${i}[2] ))`;
done

unfortunately, i have some problems.

1) APP1[0]=osso-xterm does not work within qbw but from
command line using qbw_face2face.sh directly?

2) APP6[0]=qbw_monit.sh which echoes some monitoring
outputs does not work in hidden mode but in visible.

3) i cant start several apps with this widget. in hidden mode
only one app launches, in visible up to two?

For those who want to play with the widget:

* Import the widget via qbw/avanced/import, see wiki
* modify the script, i.e. change the APP{I} arrays for your needs
* to get the correct clickpositions you can uncomment the
two lines

Code:
      #eval echo \${APP${i}[0]} ;
      #echo $CLICK_X $CLICK_Y;
What about using example for X,Y here and ways of running external apps from here?

Sorry ... don't understand what you mean by visible mode and invisible/hidden mode
__________________
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-08-22 at 21:17.
 

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