From ab4917c53a6849945ac308361291f4ad790b3a76 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Mon, 10 Aug 2026 12:59:58 -0700 Subject: [PATCH] Update select-sound-output.sh --- system-menu/select-sound-output.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/system-menu/select-sound-output.sh b/system-menu/select-sound-output.sh index 917948d..6d36065 100755 --- a/system-menu/select-sound-output.sh +++ b/system-menu/select-sound-output.sh @@ -9,14 +9,17 @@ get_default_sink() { echo "error: getting default sink with wpctl failed with error code ${?}" >&2 exit 1 elif [[ ${first_line} =~ '^id ([0-9]+), ' ]]; then - printf '%s' "${match}" + pw-dump | jq -r --argjson def_sink "${match}" \ + '.[] | select(.id == $def_sink) + | .info.props + | "\(.["node.nick"]) - \(.["node.description"]) (\($def_sink))"' else echo "error: getting default sink with wpctl failed" >&2 exit 1 fi } -let current_sink="$(get_default_sink)" +local current_sink_desc="$(get_default_sink)" local JQ_SCRIPT=$(<<'EOF' .[] | select(.type == "PipeWire:Interface:Node" @@ -57,7 +60,7 @@ done local fuzzel_index fuzzel_index="$(printf '%s\0icon\x1f%s\n' ${fuzzel_ents} \ - | fuzzel -p "Cur: ${current_sink}> " --dmenu --index)" + | fuzzel --mesg "Current: ${current_sink_desc}" --dmenu --index)" if (( ${?} )); then echo "Canceled by user" >&2 exit 0