diff --git a/check-bt.sh b/check-bt.sh new file mode 100755 index 0000000..c6e9ffb --- /dev/null +++ b/check-bt.sh @@ -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 diff --git a/config b/config index 3bc0f1a..990d66f 100644 --- a/config +++ b/config @@ -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 diff --git a/polybar.conf b/polybar.conf index 53af4c5..097b740 100644 --- a/polybar.conf +++ b/polybar.conf @@ -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