View Single Post
kamiwey's Avatar
Posts: 121 | Thanked: 100 times | Joined on Jun 2010
#732
Originally Posted by No!No!No!Yes! View Post



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 no,no,no,yes, im trying to use this to make a button to pause and resume the mediaplayer but it dosent work, have you any script or you know the way to can get it in only one button, cuz i was reading the wiki but to can play, pause and resume i must to have 3 buttons, nad i only want 2 same like in the mediaplayer widget, can you help me please?

kind regards and thanks in advance