1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-25 20:58:37 -06:00
random/bluetooth-toggle

13 lines
359 B
Text
Raw Normal View History

2021-04-19 13:54:49 -05:00
# Toggles bluetooth on a Linux system. Make sure that you have bluetoothctl installed.
# I use it with a shortcut.
2021-12-28 02:54:26 -06:00
#!/bin/sh
2021-04-19 13:54:49 -05:00
2021-12-03 20:10:59 -06:00
if [ $(bluetoothctl show | grep Powered | grep -c yes) -eq 1 ]; then
2021-04-19 13:54:49 -05:00
bluetoothctl power off
else
2021-12-08 19:35:57 -06:00
if [ $(rfkill --output-all | grep bluetooth | grep -c blocked) -ne 0 ]; then
rfkill unblock bluetooth
fi
2021-04-19 13:54:49 -05:00
bluetoothctl power on
2021-12-03 20:10:59 -06:00
fi