Skip to content

Instantly share code, notes, and snippets.

@jsonfry
jsonfry / extend.sh
Last active April 11, 2017 08:20 — forked from bitjockey42/extend.sh
Extend non-HiDPI external display to left of HiDPI internal display
#!/bin/sh
# extend non-HiDPI external display on DP* left of a HiDPI internal display eDP*
# see also https://wiki.archlinux.org/index.php/HiDPI
# you may run into https://bugs.freedesktop.org/show_bug.cgi?id=39949
# https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/883319
# Original version from: https://gist.github.com/wvengen/178642bbc8236c1bdb67
EXT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^eDP | head -n 1`
INT=`xrandr --current | sed 's/^\(.*\) connected.*$/\1/p;d' | grep -v ^DP | head -n 1`