From 914881a3206d0e5ab5edbb53227d75e488ff873e Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 31 Mar 2018 13:16:54 +0100 Subject: [PATCH] scripts: re-add missing dock-displays utility --- scripts/dock-displays | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 scripts/dock-displays diff --git a/scripts/dock-displays b/scripts/dock-displays new file mode 100755 index 0000000..ac7244f --- /dev/null +++ b/scripts/dock-displays @@ -0,0 +1,17 @@ +#!/bin/sh +set -e + +SCALE=${1:-1.4} +OUTPUT=eDP1 +NWIDTH=2160 +NHEIGHT=1440 + +WIDTH="$(bc <<< "$NWIDTH / $SCALE")" # $(($NWIDTH / $SCALE)) +HEIGHT="$(bc <<< "$NHEIGHT / $SCALE")" # $(($NHEIGHT / $SCALE)) + +MODELINE=$(cvt $WIDTH $HEIGHT | sed -n 's/Modeline\s*//p' | tr -d \") +MODENAME=${MODELINE%% *} + +xrandr --newmode $MODELINE 2>/dev/null || true +xrandr --addmode $OUTPUT $MODENAME 2>/dev/null || true +xrandr --output $OUTPUT --mode $MODENAME