This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
ID="74_5C_4B_63_EF_A2" # check 'pacmd list-sinks | grep bluez' | |
#### Restart Bluetooth | |
if [ "$1" == "resetBT" ] ; then | |
sudo rfkill block bluetooth && sleep 0.1 && sudo rfkill unblock bluetooth; | |
exit; | |
fi; | |
#### Toggle listen/speak |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- define your commands here | |
commands = { | |
help = { | |
description = "List all commands, or see one's description", | |
exec = function(cmd) | |
if cmd[2] ~= nil then -- if user supplied a command name | |
if commands[cmd[2]] ~= nil then -- and if that command exists | |
print(cmd[2] .. ": " .. commands[cmd[2]].description) -- print the command's description | |
else -- if it does not exist | |
print("Command not found: " .. cmd[2]) -- inform the user |