From 981db0af3ca50d1fd2c410c7a9788fcc5d807609 Mon Sep 17 00:00:00 2001 From: Vlad Doster Date: Wed, 12 Feb 2020 13:36:10 -0500 Subject: [PATCH] Adding bluetooth scripts --- .local/bin/polybar_scripts/bluetooth | 13 +++++++++++++ .local/bin/polybar_scripts/toggle_bluetooth | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100755 .local/bin/polybar_scripts/bluetooth create mode 100755 .local/bin/polybar_scripts/toggle_bluetooth diff --git a/.local/bin/polybar_scripts/bluetooth b/.local/bin/polybar_scripts/bluetooth new file mode 100755 index 00000000..2b12a462 --- /dev/null +++ b/.local/bin/polybar_scripts/bluetooth @@ -0,0 +1,13 @@ +#!/usr/bin/env sh + +if [ $(bluetoothctl show | grep "Powered: yes" | wc -c) -eq 0 ] +then + echo "%{F#66ffffff}" +else + if [ $(echo info | bluetoothctl | grep 'Device' | wc -c) -eq 0 ] + then + echo "" + fi + echo "%{F#2193ff}" +fi + diff --git a/.local/bin/polybar_scripts/toggle_bluetooth b/.local/bin/polybar_scripts/toggle_bluetooth new file mode 100755 index 00000000..02bacb0b --- /dev/null +++ b/.local/bin/polybar_scripts/toggle_bluetooth @@ -0,0 +1,8 @@ +#!/usr/bin/env sh + +if [ $(bluetoothctl show | grep "Powered: yes" | wc -c) -eq 0 ] +then + bluetoothctl power on +else + bluetoothctl power off +fi