diff --git a/README.md b/README.md index a79d680..b30b286 100644 --- a/README.md +++ b/README.md @@ -424,6 +424,19 @@ SPICE ports the VM is connected to. ```bash cat ubuntu-focal/ubuntu-focal.ports ``` +# Accessibility + +Qemu provides support for using BrlAPI to display braille output on a real or fake device. + + +```bash +quickemu --vm ubuntu-impish.conf --accessibility braille --display sdl +``` +or even + +```bash +quickemu --vm ubuntu-impish.conf --acc brl --display sdl +``` # BIOS and EFI @@ -562,6 +575,7 @@ Usage quickemu --vm ubuntu.conf You can also pass optional parameters + --accessible : Select accessible facilitation. 'braille' (default - currently requires --display sdl )" --delete-disk : Delete the disk image and EFI variables --delete-vm : Delete the entire VM and it's configuration --display : Select display backend. 'sdl' (default), 'gtk', 'none', or 'spice' diff --git a/quickemu b/quickemu index f77c55d..94e66d8 100755 --- a/quickemu +++ b/quickemu @@ -907,6 +907,12 @@ function vm_boot() { -monitor none -serial mon:stdio) + if [[ "${ACCESSIBLE}" == "braille" ]] || [[ "${ACCESSIBLE}" == "brl" ]]; then + # shellcheck disable=SC2054 + args+=(-chardev braille,id=brltty + -device usb-braille,id=usbbrl,chardev=brltty) + fi + if [ -n "${bridge}" ]; then # Enable bridge mode networking # shellcheck disable=SC2054,SC2206 @@ -1049,6 +1055,7 @@ function usage() { echo " ${LAUNCHER} --vm ubuntu.conf" echo echo "You can also pass optional parameters" + echo " --accessible : Select accessible facilitation. 'braille' (default - currently requires --display sdl )" echo " --delete-disk : Delete the disk image and EFI variables" echo " --delete-vm : Delete the entire VM and it's configuration" echo " --display : Select display backend. 'sdl' (default), 'gtk', 'none', or 'spice'" @@ -1065,6 +1072,14 @@ function usage() { exit 1 } +# +function accessible_param_check() { + if [ "${ACCESSIBLE}" != "braille" ] && [ "${ACCESSIBLE}" != "brl" ] ; then + echo "ERROR! Requested accessiblility '${ACCESSIBLE}' is not recognised." + exit 1 + # TODO can we check the device/API is available + fi +} function display_param_check() { if [ "${OUTPUT}" != "gtk" ] && [ "${OUTPUT}" != "none" ] && [ "${OUTPUT}" != "sdl" ] && [ "${OUTPUT}" != "spice" ]; then echo "ERROR! Requested output '${OUTPUT}' is not recognised." @@ -1155,6 +1170,11 @@ if [ $# -lt 1 ]; then else while [ $# -gt 0 ]; do case "${1}" in + -acc|--acc|-accessible|--accessible|-accessibility|--accessibility) + ACCESSIBLE="${2}" + accessible_param_check + shift + shift;; -delete|--delete|-delete-disk|--delete-disk) DELETE_DISK=1 shift;;