From 129b9461b3c068ee1a618fd3520f6c16afbcb530 Mon Sep 17 00:00:00 2001 From: Simon Long Date: Thu, 24 Feb 2022 18:32:24 +0000 Subject: [PATCH] Handle cancelling overscan setting; only show connected devices --- raspi-config | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/raspi-config b/raspi-config index 00c5d2a..008ffae 100755 --- a/raspi-config +++ b/raspi-config @@ -341,7 +341,15 @@ get_overscan_kms() { do_overscan_kms() { if [ "$INTERACTIVE" = True ]; then - DEV=$(whiptail --menu "Select the output for which overscan is to be set" 20 60 10 "1" "HDMI-1" "2" "HDMI-2" 3>&1 1>&2 2>&3) + NDEVS=$(xrandr -q | grep -c connected) + if [ $NDEVS -gt 1 ] ; then + DEV=$(whiptail --menu "Select the output for which overscan is to be set" 20 60 10 "1" "HDMI-1" "2" "HDMI-2" 3>&1 1>&2 2>&3) + if [ $? -eq 1 ] ; then + return + fi + else + DEV=1 + fi if [ $(get_overscan_kms $DEV) -eq 1 ]; then DEFAULT=--defaultno else