I am running i3wm on Ubuntu 22.04 and have a script that I can manually trigger to add my second monitor if it's connected.
if [[ $(xrandr | grep -c "HDMI1 connected") -eq 1 ]]; then
xrandr --output eDP1 --primary \
--output HDMI1 --auto --rotate right \
--right-of eDP1;
else
xrandr --output eDP1 --primary;
xrandr --output HDMI1 --off;
fi
This gives me a second, vertical display to my right which I can use to scroll through long documents or email inboxes while I focus on the main screen in front of me.
My admittedly minor gripe is that the two screens are aligned at the top, meaning if I move my cursor from the top right corner of my main screen, it goes to the top left corner of the second screen. Seems logical enough.
However, the two monitors are aligned at the bottom, and I would like the displays to be aligned that way, too, i.e., if I move from the top right corner of the main screen, it should go to somewhere in the middle of the right screen.
I've tried adding a --pos XxY
argument after --right-of eDP1
in the line for the second monitor, but no combination of X or Y values seems to work to shift the second screen to the position I want.
I can drag and drop the screens in gnome-control-center
to achieve what I want if I log in on other DMs, but using those X and Y offsets on i3 has never worked.
What am I missing here?