From 8b171ea6ff8f4cebd4005296cbcf44f6b5a68378 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Fri, 15 Sep 2023 13:47:28 -0700 Subject: [PATCH] Make select-sound-output.sh work on both x and wayland --- select-sound-output.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/select-sound-output.sh b/select-sound-output.sh index 057c3c7..6d3f373 100755 --- a/select-sound-output.sh +++ b/select-sound-output.sh @@ -12,8 +12,11 @@ for ((i = 1; i <= "${#ids}"; ++i)); do fi query_string+="${ids[${i}]}: ${descs[${i}]} (${names[${i}]})\n" done +[[ -v WAYLAND_DISPLAY ]] \ + && prompt_cmd=("fuzzel" "-dp" "${default_id}> ") \ + || prompt_cmd=("dmenu" "-p" "${default_id}:") local choice -choice="$(echo "${query_string%"\n"}" | fuzzel -dp "${default_id}> ")" +choice="$(echo "${query_string%"\n"}" | ${prompt_cmd})" if (( "${?}" != 0 )); then exit fi