From: Silvio Rhatto Date: Tue, 10 Jan 2017 15:35:57 +0000 (-0200) Subject: Updates xres X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=3a8f0e063562be65aa79c88e81555cd9b8468367;p=utils-x11.git Updates xres --- diff --git a/xres b/xres index 200753d..d2b22c3 100755 --- a/xres +++ b/xres @@ -21,11 +21,15 @@ elif ! which xrandr &> /dev/null; then fi # Get modeline and interface -MODELINE="`cvt $X $Y | grep -v '^#'` | sed -e 's/^Modeline //'" +MODELINE="`cvt $X $Y | grep -v '^#' | sed -e 's/^Modeline //'`" INTERFACE="`xrandr | grep " connected" | cut -d ' ' -f 1 | head`" -NAME="`echo $MODELINE | cut -d ' ' -f 1 | sed -e 's/"//g'`" +NAME="`echo $MODELINE | cut -d ' ' -f 1 | sed -e 's/"//g'`" + +# Add modeline +if ! xrandr | grep -q $NAME; then + xrandr --newmode $MODELINE +fi # Apply -xrandr --newmode $MODELINE xrandr --addmode $INTERFACE $NAME xrandr --output $INTERFACE --mode $NAME