diff --git a/i3_switch_monitor.sh b/i3_switch_monitor.sh index 2bf4ce1..877a5a0 100755 --- a/i3_switch_monitor.sh +++ b/i3_switch_monitor.sh @@ -11,7 +11,7 @@ getMouseX() { getMouveNextX() { if [ $(getMouseX) -lt $MONITOR1_WIDTH ]; then echo $(($MONITOR1_WIDTH + $MONITOR2_WIDTH / 2 - 10)) - elif [ $(getMouseX) -lt $(($MONITOR1_WIDTH + $MONITOR2_WIDTH)) ]; then + elif [ -n "$MONITOR3_WIDTH" -a $(getMouseX) -lt $(($MONITOR1_WIDTH + $MONITOR2_WIDTH)) ]; then echo $(($MONITOR1_WIDTH + $MONITOR2_WIDTH + $MONITOR3_WIDTH / 2 - 10)) else echo $((MONITOR1_WIDTH / 2 - 10)) diff --git a/i3_switch_monitor_wrapper.sh b/i3_switch_monitor_wrapper.sh index 12570ee..db46561 100755 --- a/i3_switch_monitor_wrapper.sh +++ b/i3_switch_monitor_wrapper.sh @@ -1,3 +1,3 @@ #!/bin/sh -exec ~/bin/i3_switch_monitor.sh 1920 1920 1024 +exec ~/bin/i3_switch_monitor.sh $(xrandr | grep ' connected' | sed 's/ primary//' | awk '{print $3}' | cut -dx -f1)