Make select-sound-output.sh work on both x and wayland

This commit is contained in:
Alexander Rosenberg 2023-09-15 13:47:28 -07:00
parent 59dfe1565b
commit 8b171ea6ff
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

View File

@ -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