linutil/tabs/utils/monitor-control/reset_scaling.sh

26 lines
828 B
Bash
Raw Normal View History

2024-08-15 03:41:41 +01:00
#!/bin/sh -e
2024-08-21 08:18:34 +01:00
. ./utility_functions.sh
2024-09-12 21:14:50 +01:00
. ../../common-script.sh
# Function to Reset scaling back to 1 (native resolution) for all monitors
Reset_scaling() {
printf "%b\n" "${YELLOW}=========================================${RC}"
printf "%b\n" "${YELLOW} Reset Monitor Scaling to Native Resolution${RC}"
printf "%b\n" "${YELLOW}=========================================${RC}"
monitor_list=$(detect_connected_monitors)
2024-09-12 21:14:50 +01:00
monitor_array=$(echo "$monitor_list" | tr '\n' ' ')
2024-09-12 21:14:50 +01:00
for monitor in $monitor_array; do
printf "%b\n" "${CYAN}Resetting scaling for $monitor to 1x1 (native resolution)${RC}"
execute_command "xrandr --output $monitor --scale 1x1"
done
2024-09-12 21:14:50 +01:00
printf "%b\n" "${GREEN}All monitor scalings have been Reset to 1x1.${RC}"
}
2024-09-12 21:14:50 +01:00
# Call the Reset_scaling function
Reset_scaling