linutil/src/commands/utils/monitor-control/duplicate_displays.sh

17 lines
470 B
Bash
Raw Normal View History

2024-08-15 03:41:41 +01:00
#!/bin/sh -e
2024-08-16 07:18:21 +01:00
. ./utils/monitor-control/utility_functions.sh
# Function to duplicate displays
duplicate_displays() {
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
echo "Duplicating $monitor to $primary"
execute_command "xrandr --output $monitor --same-as $primary"
fi
done
}
duplicate_displays