summaryrefslogtreecommitdiffstats
path: root/mga-bg-res/mga-bg-res.sh
diff options
context:
space:
mode:
authorBarry Jackson <barjac@mageia.org>2016-09-10 14:41:27 +0100
committerBarry Jackson <barjac@mageia.org>2016-09-10 14:41:27 +0100
commit033495bdf1cb67f612418d13adf789d56bbcdc30 (patch)
tree650c019e483eae31c12ffe55f6d05ca7d1745084 /mga-bg-res/mga-bg-res.sh
parent6cfbce46434a36c0a053cd2960847c916291a8fb (diff)
downloadtheme-033495bdf1cb67f612418d13adf789d56bbcdc30.tar
theme-033495bdf1cb67f612418d13adf789d56bbcdc30.tar.gz
theme-033495bdf1cb67f612418d13adf789d56bbcdc30.tar.bz2
theme-033495bdf1cb67f612418d13adf789d56bbcdc30.tar.xz
theme-033495bdf1cb67f612418d13adf789d56bbcdc30.zip
switch curlink to default.png and link default.jpg to it
Diffstat (limited to 'mga-bg-res/mga-bg-res.sh')
-rwxr-xr-xmga-bg-res/mga-bg-res.sh16
1 files changed, 9 insertions, 7 deletions
diff --git a/mga-bg-res/mga-bg-res.sh b/mga-bg-res/mga-bg-res.sh
index 3dc8416..b6b0f24 100755
--- a/mga-bg-res/mga-bg-res.sh
+++ b/mga-bg-res/mga-bg-res.sh
@@ -2,7 +2,7 @@
bgpath="/usr/share/mga/backgrounds"
theme="Mageia-Default"
-curlink=$(readlink $bgpath/default.jpg)
+curlink=$(readlink $bgpath/default.png)
# Search for the optimal background resolution according to monitor-edid
if [ -e /usr/sbin/monitor-edid ]; then
@@ -16,12 +16,12 @@ if [ -z $res ]; then
fi
# Check if the symlink is already good
-if [ "$curlink" = "$bgpath/$theme-$res.jpg" ]; then
+if [ "$curlink" = "$bgpath/$theme-$res.png" ]; then
exit 0
fi
# Check if this is a supported resolution, if not, find the background with a similar aspect ratio
-if [ ! -e "$bgpath/$theme-$res.jpg" ]; then
+if [ ! -e "$bgpath/$theme-$res.png" ]; then
width=$(echo $res | cut -f1 -d"x")
height=$(echo $res | cut -f2 -d"x")
# Bash only does integer arithmetic, we multiply everything by 1000 to workaround this
@@ -38,15 +38,17 @@ fi
# Check again if the symlink does not already point to this new resolution
# If not, create a new symlink
-if [ "$curlink" != "$bgpath/$theme-$res.jpg" ]; then
- if [ -e "$bgpath/$theme-$res.jpg" ]; then
- ln -sf $bgpath/$theme-$res.jpg $bgpath/default.jpg
+if [ "$curlink" != "$bgpath/$theme-$res.png" ]; then
+ if [ -e "$bgpath/$theme-$res.png" ]; then
+ ln -sf $bgpath/$theme-$res.png $bgpath/default.png
+ ln -sf $bgpath/default.png $bgpath/default.jpg
if [ -d /boot/grub2/themes ]; then
cp -f $bgpath/$theme-$res.png /boot/grub2/themes/grub2-mageia-default.png
fi
else
- echo -e "Could not find this file: $bgpath/$theme-$res.jpg."
+ echo -e "Could not find this file: $bgpath/$theme-$res.png"
echo "Please check that the mageia-theme-Default package is properly installed, or disable"
echo "the mga-bg-res systemd service if you do not want to force using the Mageia theme."
fi
fi
+