From 03de6daf6426cc1df1fbeaa5ba7f22046fb46223 Mon Sep 17 00:00:00 2001 From: Siegfried Krug Date: Sun, 8 Feb 2015 22:40:57 +0100 Subject: [PATCH] Upload first version. --- bluetoothkey | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bluetoothkey 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