summaryrefslogtreecommitdiffstats
path: root/mga-bg-res
diff options
context:
space:
mode:
Diffstat (limited to 'mga-bg-res')
-rw-r--r--mga-bg-res/NEWS2
-rwxr-xr-xmga-bg-res/mga-bg-res.sh8
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