Remove bashisms out of change orientation (#466)

Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com>
This commit is contained in:
Nyx 2024-09-18 14:32:35 -04:00 committed by GitHub
parent e049d3c6aa
commit d2b4875751
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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