diff options
Diffstat (limited to 'polybar')
-rwxr-xr-x | polybar/.config/polybar/bt.sh | 13 | ||||
-rwxr-xr-x | polybar/.config/polybar/config | 3 |
2 files changed, 14 insertions, 2 deletions
diff --git a/polybar/.config/polybar/bt.sh b/polybar/.config/polybar/bt.sh index 177932b..3f3b6ec 100755 --- a/polybar/.config/polybar/bt.sh +++ b/polybar/.config/polybar/bt.sh | |||
@@ -3,7 +3,6 @@ | |||
3 | bluetooth_print() { | 3 | bluetooth_print() { |
4 | bluetoothctl | while read -r; do | 4 | bluetoothctl | while read -r; do |
5 | if [ "$(systemctl is-active "bluetooth.service")" = "active" ]; then | 5 | if [ "$(systemctl is-active "bluetooth.service")" = "active" ]; then |
6 | # printf 'on' | ||
7 | 6 | ||
8 | devices_paired=$(bluetoothctl devices | grep Device | cut -d ' ' -f 2) | 7 | devices_paired=$(bluetoothctl devices | grep Device | cut -d ' ' -f 2) |
9 | counter=0 | 8 | counter=0 |
@@ -54,10 +53,22 @@ bluetooth_toggle() { | |||
54 | fi | 53 | fi |
55 | } | 54 | } |
56 | 55 | ||
56 | bluetooth_connect() { | ||
57 | if bluetoothctl show | grep -q "Powered: yes"; then | ||
58 | devices_paired=$(bluetoothctl devices | grep Device | cut -d ' ' -f 2) | ||
59 | echo "$devices_paired" | while read -r line; do | ||
60 | bluetoothctl connect "$line" >> /dev/null | ||
61 | done | ||
62 | fi | ||
63 | } | ||
64 | |||
57 | case "$1" in | 65 | case "$1" in |
58 | --toggle) | 66 | --toggle) |
59 | bluetooth_toggle | 67 | bluetooth_toggle |
60 | ;; | 68 | ;; |
69 | --connect) | ||
70 | bluetooth_connect | ||
71 | ;; | ||
61 | *) | 72 | *) |
62 | bluetooth_print | 73 | bluetooth_print |
63 | ;; | 74 | ;; |
diff --git a/polybar/.config/polybar/config b/polybar/.config/polybar/config index 425e225..72e4c65 100755 --- a/polybar/.config/polybar/config +++ b/polybar/.config/polybar/config | |||
@@ -187,7 +187,8 @@ bar-progress-empty = ─ | |||
187 | type = custom/script | 187 | type = custom/script |
188 | exec = ~/.config/polybar/bt.sh | 188 | exec = ~/.config/polybar/bt.sh |
189 | tail = true | 189 | tail = true |
190 | click-left = ~/.config/polybar/bt.sh --toggle & | 190 | click-left = ~/.config/polybar/bt.sh --connect & |
191 | click-right = ~/.config/polybar/bt.sh --toggle & | ||
191 | format = tooth <label> | 192 | format = tooth <label> |
192 | label = %output% | 193 | label = %output% |
193 | label-foreground = #EEFFFF | 194 | label-foreground = #EEFFFF |