I have found this answer that shows how to toggle WiFi using a keyboard shortcut: https://apple.stackexchange.com/a/194372/406298.
I have created a new Action in the automater app to run the shell command provided in the answer:
networksetup -getairportpower en1 | grep "On" && networksetup -setairportpower en1 off || networksetup -setairportpower en1 on
Then, I have added the Actions shortcut in the keyboard's Touchbar to toggle WiFi from the Touchbar.
This works great as a quick WiFi toggle from the touchbar. However, I would like to do the same for Blutooth. Is there a similar simple shell command to toggle Bluetooth?
Thank you in advance.