Awesome script!
I made a small change to display the current Bluetooth status when running the command (I have the Bluetooth icon hidden, so I need that )
Instead of the bluetooth keyword component use a script filter with the following contents:
Keyword: bluetooth (or anything you want), no arguments
Placeholder Title: Toggle Bluetooth (or anything you want)
Script:
BT=$(./blueutil status)
cat << EOB
<?xml version="1.0"?>
<items>
<item uid="com.petrmanas.btwftoggle" arg="$BT" valid="yes" type="file">
<title>Toggle Bluetooth</title>
<subtitle>$BT</subtitle>
<icon type="file">icon.png</icon>
</item>
</items>
EOB
Connect with the existing "Run Script" component. Enjoy!