diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2015-05-09 19:53:20 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2015-05-09 19:53:20 +0200 |
commit | ed067076a810bc396fc357dd8b0813095bb0c604 (patch) | |
tree | a610f5bdf8cb85eebbef1c8db135d86c8841d457 /mga-bg-res | |
parent | ca81d4e098169fcee00663be872719cd33b62045 (diff) | |
download | theme-ed067076a810bc396fc357dd8b0813095bb0c604.tar theme-ed067076a810bc396fc357dd8b0813095bb0c604.tar.gz theme-ed067076a810bc396fc357dd8b0813095bb0c604.tar.bz2 theme-ed067076a810bc396fc357dd8b0813095bb0c604.tar.xz theme-ed067076a810bc396fc357dd8b0813095bb0c604.zip |
Make sure to default to 4:3 aspect ratio if monitor-probe fails (previous fix was incomplete)
Diffstat (limited to 'mga-bg-res')
-rw-r--r-- | mga-bg-res/NEWS | 2 | ||||
-rwxr-xr-x | 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 |