diff options
Diffstat (limited to 'mga-bg-res/mga-bg-res.sh')
-rwxr-xr-x | mga-bg-res/mga-bg-res.sh | 8 |
1 files changed, 5 insertions, 3 deletions
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 |