Prototype for trying out blesh

This commit is contained in:
2025-10-12 17:54:04 -04:00
parent d67b07d275
commit e8fca12861
2 changed files with 42 additions and 9 deletions

View File

@@ -74,3 +74,29 @@ prompt_command_prepend() {
arg=${1}
PROMPT_COMMAND="${arg}"${PROMPT_COMMAND:+"; $PROMPT_COMMAND"}
}
blesh-activate()
{
BLESH_PATH=$HOME/.nix-profile/share/blesh/ble.sh
if [ -r $BLESH_PATH ]; then
[[ $- == *i* ]] && . $HOME/.nix-profile/share/blesh/ble.sh
[[ ! ${BLE_VERSION-} ]] || ble-attach
fi
}
blesh-available() {
BLESH_PATH=$HOME/.nix-profile/share/blesh/ble.sh
if [ -r $BLESH_PATH ]; then
return 0
else
return 1
fi
}
blesh-attached () {
if [ -z ${BLE_VERSION:+x} ]; then
return 1
else
return 0
fi
}