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

17 lines
491 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
# Function to extend displays
extend_displays() {
monitors=($(detect_connected_monitors))
for ((i=1; i<${#monitors[@]}; i++)); do
if confirm_action "Extend ${monitors[$i]} to the right of ${monitors[$((i-1))]}?"; then
echo "Extending ${monitors[$i]} to the right of ${monitors[$((i-1))]}"
execute_command "xrandr --output ${monitors[$i]} --right-of ${monitors[$((i-1))]}"
fi
done
}
extend_displays