add already connected notification

This commit is contained in:
speedie 2022-08-24 12:36:34 +02:00
parent 6cb886e00f
commit 906a39f65d

View file

@ -91,26 +91,38 @@ UNTRUST() {
# Connect
CONNECT() {
if [ -e "$/tmp/isconnected" ]; then
NOTIFY_ALREADY_CONNECTED && exit 0
fi
bluetoothctl connect $SELDEVICE_MAC
touch /tmp/isconnected
}
# Disconnect
DISCONNECT() {
rm -f /tmp/isconnected
bluetoothctl disconnect $SELDEVICE_MAC
}
# Notification when connecting
NOTIFY_CONNECT() {
notify-send " Connected to $USEROPT_1"
notify-send " Connected to ${USEROPT_1}!"
}
# Notification when disconnecting
NOTIFY_DISCONNECT() {
notify-send " Disconnected from $USEROPT_1"
notify-send " Disconnected from ${USEROPT_1}!"
}
# Notification when removing
NOTIFY_REMOVE() {
notify-send " Removed $USEROPT_1"
notify-send " Removed ${USEROPT_1}!"
}
# Notification when already connected
NOTIFY_ALREADY_CONNECTED() {
notify-send " Device $USEROPT_1 is already connected!"
}
# Perform actions as per user choice