aboutsummaryrefslogtreecommitdiff
path: root/xres
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-01-10 13:53:42 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-01-10 13:53:42 -0200
commit93256841deaf8771a07ce853987f178b04c795d5 (patch)
tree0e16932a080db2efd10c9d4baed4c4620d5da7fd /xres
parenta87516e177ba31215e6811094e92cb3412be4a23 (diff)
downloadutils-x11-93256841deaf8771a07ce853987f178b04c795d5.tar.gz
utils-x11-93256841deaf8771a07ce853987f178b04c795d5.tar.bz2
Simplify xres
Diffstat (limited to 'xres')
-rwxr-xr-xxres6
1 files changed, 1 insertions, 5 deletions
diff --git a/xres b/xres
index 2a385cf..5495b6c 100755
--- a/xres
+++ b/xres
@@ -25,11 +25,7 @@ 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'`"
-# Add modeline
-if ! xrandr | grep -q -e "^ $NAME"; then
- xrandr --newmode $MODELINE
-fi
-
# Apply
+xrandr --newmode $MODELINE &> /dev/null
xrandr --addmode $INTERFACE $NAME
xrandr --output $INTERFACE --mode $NAME