summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2023-12-11 20:17:58 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2023-12-11 20:17:58 +0530
commit25959bc79f02f95a0894697a774cfe441f719652 (patch)
tree2d36a405348751563b60b2ac912055b19759b861
parent7c4c6f1d1678fea4ee3b8e0eda54c489050e00bf (diff)
.scripts: bts - removing pacmd and using pactl, updating incorrect profile values
-rwxr-xr-x.scripts/bts10
1 files 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