From 0a6d5c35d3d4e39512bdab5d812cd4de63a02048 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Wed, 24 Aug 2011 01:13:49 +0200 Subject: [PATCH] [script][get_madame] Correct xrandr use --- scripts/getMadame.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/getMadame.sh b/scripts/getMadame.sh index 6be6eb2..f0d5ad0 100755 --- a/scripts/getMadame.sh +++ b/scripts/getMadame.sh @@ -14,7 +14,6 @@ ########################################### page= -set -x function usage { script_name=`basename "$0"` echo "Usage $script_name [Day]" @@ -68,7 +67,7 @@ function resize { res= if [ -e /usr/bin/xrandr ]; then - res=$(xrandr | tail -1 | awk '{print $1}') + res=$(xrandr | grep '*' | awk '{print $1}') else res=$(xdpyinfo | grep dimensions | awk '{print $2}') fi @@ -84,7 +83,7 @@ function resize { mult=0 div=0 # If using $tailleX and $imgX as factor scale for Y -> use it! It will perfectly fitt for X and do the best for Y - if [ $tailleY -gt $((($tailleX*$imgY)/$imgX)) ]; + if [[ $tailleY -gt $((($tailleX*$imgY)/$imgX)) ]]; then mult=$tailleX div=$imgX