However, in "mirrored display" mode, I can only select 1024x768 and 800x600 resolution as shown in the image below:
In such mode, my laptop screen has two blank strip on the left and right side. On the HDMI monitor, it shows a squashed screen (1024x768 resolution stretched to 16:9 full screen).
The solution is to use xrandr to list all display modes and add each mode into every monitor, the shell script is as follows:
displays=(`xrandr | grep '^[^ ]' | awk '{print $1}'`)You just need to run this script before plugging in the HDMI cable.
xrandr | grep "^ " | awk '{print $1}' | grep [0-9]x[0-9] | sort | uniq \
| while read mode; do
echo "Adding $mode ..."
for display in ${displays[*]}; do
xrandr --addmode $display $mode
done
done