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

19 lines
496 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 duplicate displays
duplicate_displays() {
2024-09-12 21:14:50 +01:00
primary=$(detect_connected_monitors | head -n 1)
for monitor in $(detect_connected_monitors | tail -n +2); do
if confirm_action "Duplicate $monitor to $primary?"; then
printf "%b\n" "${GREEN}Duplicating $monitor to $primary${RC}"
execute_command "xrandr --output $monitor --same-as $primary"
fi
done
}
duplicate_displays