13 lines
447 B
Bash
Executable File
13 lines
447 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# SPDX-FileCopyrightText: 2020-2021 Simon Bruder <simon@sbruder.de>
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
set -eo pipefail
|
|
card=$(pactl list cards short | grep -E -o "bluez_card.*" | cut -f1)
|
|
# pactl does not support any easily parsable output format
|
|
profile=$(pactl list cards | rg -oU "Name: ${card}.*(\\n.*?)*.*Active Profile: (.*)" -r "\$2")
|
|
pactl set-card-profile "$card" off
|
|
pactl set-card-profile "$card" "$profile"
|