updated scripts
This commit is contained in:
parent
fa169ab0b6
commit
5203fdc11f
4 changed files with 82 additions and 0 deletions
54
.local/bin/bluetooth
Executable file
54
.local/bin/bluetooth
Executable file
|
@ -0,0 +1,54 @@
|
|||
#!/bin/sh -x
|
||||
|
||||
checkstate() {
|
||||
if [ "$(bluetoothctl show | grep "Powered: yes")" ]; then
|
||||
echo " ON"
|
||||
else
|
||||
echo " OFF"
|
||||
fi
|
||||
}
|
||||
|
||||
switchstate() {
|
||||
case "$(checkstate | fuzzel -d)" in
|
||||
" ON")
|
||||
bluetoothctl power off
|
||||
notify-send "Bluetooth" "Bluetooth is disabled"
|
||||
;;
|
||||
" OFF")
|
||||
echo "Bluetooth is enabled"
|
||||
bluetoothctl power on
|
||||
notify-send "Bluetooth" "Bluetooth is enabled"
|
||||
;;
|
||||
*) exit ;;
|
||||
esac
|
||||
}
|
||||
|
||||
checkstate() {
|
||||
if [ "$(bluetoothctl show | grep "Powered: yes")" ]; then
|
||||
echo " ON"
|
||||
else
|
||||
echo " OFF"
|
||||
fi
|
||||
}
|
||||
|
||||
switchstate() {
|
||||
case "$(checkstate | fuzzel -d)" in
|
||||
" ON")
|
||||
bluetoothctl power off
|
||||
notify-send "Bluetooth" "Bluetooth is disabled"
|
||||
;;
|
||||
" OFF")
|
||||
echo "Bluetooth is enabled"
|
||||
bluetoothctl power on
|
||||
notify-send "Bluetooth" "Bluetooth is enabled"
|
||||
;;
|
||||
*) exit ;;
|
||||
esac
|
||||
}
|
||||
|
||||
case $(printf "%s\n" " Connect Device" " Change State" | fuzzel -d) in
|
||||
" Connect Device")
|
||||
echo menu ;;
|
||||
" Change State") switchstate ;;
|
||||
*) exit ;;
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue