From ed067076a810bc396fc357dd8b0813095bb0c604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sat, 9 May 2015 19:53:20 +0200 Subject: Make sure to default to 4:3 aspect ratio if monitor-probe fails (previous fix was incomplete) --- mga-bg-res/NEWS | 2 ++ mga-bg-res/mga-bg-res.sh | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mga-bg-res/NEWS b/mga-bg-res/NEWS index b011832..65d129a 100644 --- a/mga-bg-res/NEWS +++ b/mga-bg-res/NEWS @@ -1,3 +1,5 @@ +- Make sure to default to 4:3 aspect ratio if monitor-probe fails (previous + fix was incomplete) - Fix exit value when symlink is already correct Version 0.7 (2015-05-02): diff --git a/mga-bg-res/mga-bg-res.sh b/mga-bg-res/mga-bg-res.sh index cff01a8..e73caa4 100755 --- a/mga-bg-res/mga-bg-res.sh +++ b/mga-bg-res/mga-bg-res.sh @@ -4,9 +4,6 @@ bgpath="/usr/share/mga/backgrounds" theme="Mageia-Default" curlink=$(readlink $bgpath/default.jpg) -# If the following tests bail out, default to 4:3 aspect ratio (e.g. 1024x768) -res="1600x1200" - # Search for the optimal background resolution according to the driver DRIVER=$(grep -A 6 'Device' /etc/X11/xorg.conf | grep 'Driver') # => Driver "DriverName" DRIVER=$(expr "$DRIVER" : '.*"\(.*\)"') # isolate driver's name @@ -15,6 +12,11 @@ if [ ! -z "$DRIVER" -a -e /usr/sbin/monitor-probe ]; then res=$(expr "$res" : '.*"\(.*\)".*') # isolate the resolution fi +# If the previous method did not work, default to 4:3 aspect ratio (e.g. 1024x768) +if [ -z $res ]; then + res="1600x1200" +fi + # Check if the symlink is already good if [ "$curlink" = "$bgpath/$theme-$res.jpg" ]; then exit 0 -- cgit v1.2.1