Skip to content

Instantly share code, notes, and snippets.

@linxlunx
Created May 2, 2020 06:03
Show Gist options
  • Save linxlunx/2b13c39162f3d3e012f8bb4c9c3670c0 to your computer and use it in GitHub Desktop.
Save linxlunx/2b13c39162f3d3e012f8bb4c9c3670c0 to your computer and use it in GitHub Desktop.
# This is my configuration with 4K laptop and 1080p monitor in Linux
# When 4K laptop is connected with 1080p monitor, the monitor scale is not proportional
# The configuration is different when extended monitor is put on the left or right side, so we have to set the panning
if [ "$1" == "right" ]
then xrandr --output DP-1 --scale 2.0x2.0 --panning 3840x2160+3200+0 --fb 7040x2160 --right-of eDP-1
elif [ "$1" == "left" ]
then xrandr --fb 7040x2160 --output eDP-1 --panning 3200x1800+3840+0 --right-of DP-1 --output DP-1 --mode 1920x1080 --scale 2x2 --primary
else echo -e "Please choose the position, right or left\nUsage: $0 right|left\n"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment