2024-08-15 03:41:41 +01:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2024-08-21 08:18:34 +01:00
|
|
|
. ./utility_functions.sh
|
2024-08-05 20:24:05 +01:00
|
|
|
|
2024-09-12 21:14:50 +01:00
|
|
|
. ../../common-script.sh
|
|
|
|
|
2024-08-05 20:24:05 +01:00
|
|
|
# Function to extend displays
|
|
|
|
extend_displays() {
|
2024-09-12 21:14:50 +01:00
|
|
|
monitors=$(detect_connected_monitors)
|
|
|
|
monitor_array=$(echo "$monitors" | tr '\n' ' ')
|
|
|
|
i=1
|
|
|
|
for monitor in $monitor_array; do
|
|
|
|
if [ "$i" -gt 1 ]; then
|
|
|
|
prev_monitor=$(echo "$monitor_array" | cut -d' ' -f$((i-1)))
|
|
|
|
if confirm_action "Extend $monitor to the right of $prev_monitor?"; then
|
|
|
|
printf "%b\n" "${GREEN}Extending $monitor to the right of $prev_monitor${RC}"
|
|
|
|
execute_command "xrandr --output $monitor --right-of $prev_monitor"
|
|
|
|
fi
|
2024-08-05 20:24:05 +01:00
|
|
|
fi
|
2024-09-12 21:14:50 +01:00
|
|
|
i=$((i + 1))
|
2024-08-05 20:24:05 +01:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
extend_displays
|