diff --git a/bluetoothkey b/bluetoothkey new file mode 100755 index 0000000..74fdc32 --- /dev/null +++ b/bluetoothkey @@ -0,0 +1,17 @@ +#!/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