View Single Post
Posts: 44 | Thanked: 18 times | Joined on Jul 2008
#667
Wow now I feel even more like an idiot, so many parts of what I was doing is completely inelegant. I blame the 35C heat wave knocking out my brain cells. Here's a revised version of the script I was working on without all that nonsense (command only this time, cause I fail at single lines)...

Code:
[queen-beecon-header]
version=1.000000
checksum=312170
[queen-beecon-exported-command]
title=WiFi+
command=if [ $QBW_EXEC_REASON == QBW_STARTUP_UPDATE ]; then
   exit 0;
fi;

if [ $QBW_EXEC_REASON == QBW_DBUS_MONITOR ]; then
 if echo '$QBW_DBUS_VERBOSE_OUTPUT' | grep -q "CONNECTED"
 then
   exit 1;
 else
   exit 0;
 fi;
fi;

if [ $QBW_EXEC_REASON == QBW_CLICK ]; then
 if [ $QBW_IS_CONNECTED == false ]; then
   dbus-send --system --type=method_call --dest=com.nokia.icd
/com/nokia/icd com.nokia.icd.connect string:"[ANY]" uint32:0;
 exit 1;
 else
   dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui
com.nokia.icd_ui.disconnect boolean:true;
 exit 0;
 fi;
fi;
Works quite nifty with the on-button.png and off-button.png that No!No!No!Yes! provided a few pages back. Thanks for the quick reply, it helped ALOT, and thanks again for the ridiculously powerful and useful widget scripting system!
 

The Following User Says Thank You to IcyAirs For This Useful Post: