bluetoothkey/bluetoothkey

18 lines
436 B
Bash
Executable File

#!/bin/bash
#get status
status=$(rfkill list bluetooth | grep "Soft blocked")
#working part
if [[ "$status" =~ "yes" ]]
then
#if interface is disabled, activate it
rfkill unblock bluetooth
notify-send 'Bluetooth' 'The Bluetooth device is enabled' --icon=dialog-information
else
#if interface is enabled, deactivate it
rfkill block bluetooth
notify-send 'Bluetooth' 'The Bluetooth device is disabled' --icon=dialog-information
fi