From 25959bc79f02f95a0894697a774cfe441f719652 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Mon, 11 Dec 2023 20:17:58 +0530 Subject: .scripts: bts - removing pacmd and using pactl, updating incorrect profile values --- .scripts/bts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.scripts/bts b/.scripts/bts index 0a1fb80..a33b04a 100755 --- a/.scripts/bts +++ b/.scripts/bts @@ -31,15 +31,15 @@ case $option in "Change profile") past_profile=$(pactl list | grep "Active Profile" | sed '2p;d' | cut -d ' ' -f 3) profile=$(echo -e "a2dp_sink(pure audio output)\nhandsfree_head_unit(inferior audio output + mic enable)" | tofi --prompt-text "Choose the profile for your sound card") - cardindex=$(pacmd list-cards | grep 'index' | awk 'NR==2' | cut -d ' ' -f6) + cardindex=$(pactl list cards | awk '/^Card #[0-9]+$/ {getline; if ($2 ~ /^bluez_card\./) print $2}') case $profile in "a2dp_sink(pure audio output)") - pactl set-card-profile $cardindex a2dp_sink && - dunstify "Switched card profile from $past_profile to $profile" -i audio-headphones;; + pactl set-card-profile $cardindex a2dp-sink && + dunstify "Switched card profile" "from $past_profile to $profile" -i audio-headphones;; "handsfree_head_unit(inferior audio output + mic enable)") - pactl set-card-profile $cardindex handsfree_head_unit - notify-send "Switched card profile from $past_profile to $profile" -i audio-headset;; + pactl set-card-profile $cardindex headset-head-unit && + dunstify "Switched card profile" "from $past_profile to $profile" -i audio-headset;; esac;; "Reset pipewire") systemctl --user restart wireplumber pipewire pipewire-pulse -- cgit v1.2.3