From d2b4875751991b0d4d160eb22564ae7dab4148a1 Mon Sep 17 00:00:00 2001 From: Nyx <144965845+nnyyxxxx@users.noreply.github.com> Date: Wed, 18 Sep 2024 14:32:35 -0400 Subject: [PATCH] Remove bashisms out of change orientation (#466) Co-authored-by: nnyyxxxx --- tabs/utils/monitor-control/change_orientation.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tabs/utils/monitor-control/change_orientation.sh b/tabs/utils/monitor-control/change_orientation.sh index 8d867965..19e085f4 100755 --- a/tabs/utils/monitor-control/change_orientation.sh +++ b/tabs/utils/monitor-control/change_orientation.sh @@ -20,7 +20,8 @@ change_orientation() { i=$((i + 1)) done - read -p "Enter the number of the monitor: " monitor_choice + printf "Enter the number of the monitor: " + read -r monitor_choice if ! echo "$monitor_choice" | grep -qE '^[0-9]+$' || [ "$monitor_choice" -lt 1 ] || [ "$monitor_choice" -gt "$((i - 1))" ]; then printf "%b\n" "${RED}Invalid selection.${RC}" @@ -39,8 +40,8 @@ change_orientation() { printf "%b\n" "3. ${GREEN}Right${RC}" printf "%b\n" "4. ${GREEN}Inverted${RC}" - read -p "Enter the number of the orientation: " orientation_choice - + printf "Enter the number of the orientation: " + read -r orientation_choice case $orientation_choice in 1) orientation="normal" ;; 2) orientation="left" ;;