From 357d84f17a8c6d133ee201a44ea6563204930a8e Mon Sep 17 00:00:00 2001 From: Omarchybot <317366263+omarchybot@users.noreply.github.com> Date: Sat, 3 Oct 2026 07:06:39 +0200 Subject: [PATCH] Follow EasyEffects' links to Bluetooth sinks too EasyEffects plays into Bluetooth headphones through the same direct port links as into a card, but only alsa_output targets were followed, so with headphones on the keys fell back to the settings file -- which can still name the speakers -- or to easyeffects_sink. Match bluez_output sinks as well, and compare the configured device name literally rather than as a regex. Co-Authored-By: Claude Opus 5.5 --- bin/omarchy-audio-output-sink | 8 ++++---- test/shell.d/audio-output-sink-test.sh | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/bin/omarchy-audio-output-sink b/bin/omarchy-audio-output-sink index 1095c417..6eab9374 100755 --- a/bin/omarchy-audio-output-sink +++ b/bin/omarchy-audio-output-sink @@ -54,14 +54,14 @@ fi # own: its output node links its ports straight to the sink's playback ports, # so the sink-input search above finds nothing and the keys would move the # EasyEffects sink -- whose volume its monitor, the input of the processing, -# does not follow. Follow the port links instead: the first alsa_output sink -# any EasyEffects output port is linked to. +# does not follow. Follow the port links instead: the first ALSA or Bluetooth +# sink any EasyEffects output port is linked to. if [[ $sink == "easyeffects_sink" ]]; then linked="$(pw-link -l 2>/dev/null | awk ' /^[^ ]/ {src = $0} /^[[:space:]]*\|->/ { - if (src ~ /^ee_/ && $2 ~ /^alsa_output\..*:playback_/) { + if (src ~ /^ee_/ && $2 ~ /^(alsa|bluez)_output\..*:playback_/) { sub(/:playback_.*$/, "", $2); print $2; exit } }')" @@ -71,7 +71,7 @@ if [[ $sink == "easyeffects_sink" ]]; then if [[ -z $linked ]]; then configured="$(sed -n 's/^outputDevice=//p' \ "${XDG_CONFIG_HOME:-$HOME/.config}/easyeffects/db/easyeffectsrc" 2>/dev/null)" - if [[ -n $configured ]] && pactl list sinks short 2>/dev/null | awk '{print $2}' | grep -qx "$configured"; then + if [[ -n $configured ]] && pactl list sinks short 2>/dev/null | awk '{print $2}' | grep -qxF -- "$configured"; then linked="$configured" fi fi diff --git a/test/shell.d/audio-output-sink-test.sh b/test/shell.d/audio-output-sink-test.sh index c5cc789b..5b7505bf 100755 --- a/test/shell.d/audio-output-sink-test.sh +++ b/test/shell.d/audio-output-sink-test.sh @@ -61,6 +61,22 @@ LINKS [[ $(resolve) == "$physical" ]] || fail "easyeffects_sink resolves through the port links to the card" pass "easyeffects_sink resolves through its port links" +# EasyEffects 8 playing into Bluetooth headphones: the live links win over a +# settings file that still names the speakers. +headphones=bluez_output.00_11_22_33_44_55.1 +reset_scenario +printf '301\t%s\tPipeWire\ts16le 2ch 48000Hz\tRUNNING\n' "$headphones" >>"$test_home/data/sinks" +cat >"$test_home/data/links" < $headphones:playback_FL +ee_soe_output_level:output_FR + |-> $headphones:playback_FR +LINKS +mkdir -p "$test_home/.config/easyeffects/db" +printf '[StreamOutputs]\noutputDevice=%s\n' "$physical" >"$test_home/.config/easyeffects/db/easyeffectsrc" +[[ $(resolve) == "$headphones" ]] || fail "easyeffects_sink resolves through its port links to Bluetooth headphones" +pass "easyeffects_sink resolves through its port links to Bluetooth headphones" + # EasyEffects 8 idle: no links, but its settings name the output device. reset_scenario mkdir -p "$test_home/.config/easyeffects/db"