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