Browse Source

improved bluetooth phones detecting

master
bvn13 2 years ago
parent
commit
4c6da81c7f
  1. 11
      check-bt.sh
  2. 4
      config
  3. 6
      polybar.conf

11
check-bt.sh

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
#!/bin/bash
if [[ $(pactl list short | grep 'bluez_sink.2C_4D_79_47_42_9F') ]]; then
if [[ $(pactl list short | grep 'bluez_sink.2C_4D_79_47_42_9F.headset_head_unit[^.]') ]]; then
echo $(pactl list short | grep -e 'bluez_sink.2C_4D_79_47_42_9F.headset_head_unit[^.]' | awk '{print "ZOOM:"$NF}');
else
echo 'MUSIC';
fi
else
echo 'OFF';
fi

4
config

@ -12,13 +12,15 @@ set $mod Mod4 @@ -12,13 +12,15 @@ set $mod Mod4
# is used in the bar {} block below.
#font pango:monospace 8
#font pango:Iosevka Medium 8
font pango:Liberation Mono:style=Regular 8
#font pango:Cantarell:style=Regular 10
# This font is widely installed, provides lots of unicode glyphs, right-to-left
# text rendering and scalability on retina/hidpi displays (thanks to pango).
#font pango:DejaVu Sans Mono 8
# Before i3 v4.8, we used to recommend this one as the default:
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
#font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
# The font above is very space-efficient, that is, it looks good, sharp and
# clear in small sizes. However, its unicode glyph coverage is limited, the old
# X core fonts rendering does not support right-to-left and this being a bitmap

6
polybar.conf

@ -397,12 +397,10 @@ menu-2-1-exec = menu-open-0 @@ -397,12 +397,10 @@ menu-2-1-exec = menu-open-0
[module/zoom-audio]
type = custom/script
;exec = pactl list short | grep -e 'bluez_sink.2C_4D_79_47_42_9F.headset_head_unit[^.]' | awk '{print $NF}' || 'NORMAL'
label = 🎧 %output%
interval = 0.5
exec = pactl list short | grep -q 'bluez_sink.2C_4D_79_47_42_9F.headset_head_unit[^.]' && echo $(pactl list short | grep -e 'bluez_sink.2C_4D_79_47_42_9F.headset_head_unit[^.]' | awk '{print "ZOOM:"$NF}') || echo 'MUSIC'
;click-left = pactl set-card-profile bluez_card.2C_4D_79_47_42_9F headset_head_unit
;click-right = pactl set-card-profile bluez_card.2C_4D_79_47_42_9F a2dp_sink
;exec = pactl list short | grep -q 'bluez_sink.2C_4D_79_47_42_9F.headset_head_unit[^.]' && (echo $(pactl list short | grep -e 'bluez_sink.2C_4D_79_47_42_9F.headset_head_unit[^.]' | awk '{print "ZOOM:"$NF}') || echo 'MUSIC') || echo 'OFF'
exec = $HOME/.config/i3/check-bt.sh
click-left = pactl list short | grep -q 'bluez_sink.2C_4D_79_47_42_9F.headset_head_unit[^.]' && pactl set-card-profile bluez_card.2C_4D_79_47_42_9F a2dp_sink || pactl set-card-profile bluez_card.2C_4D_79_47_42_9F headset_head_unit
click-right = $HOME/.config/i3/rofi-btooth

Loading…
Cancel
Save