wallpaper image file support

This commit is contained in:
Stephan Raabe
2023-12-21 11:05:20 +01:00
parent 9033dbf59b
commit 88a73b7039
18 changed files with 88 additions and 28 deletions

View File

@@ -1,6 +1,6 @@
[General]
Background="Backgrounds/current_wallpaper.jpg"
Background="Backgrounds/CURRENTWALLPAPER"
## Path relative to the theme root directory. Most standard image file formats are allowed including support for transparency. (e.g. background.jpeg/illustration.GIF/Foto.png/undraw.svgz)

View File

@@ -9,6 +9,7 @@
# by Stephan Raabe (2023)
# -----------------------------------------------------
cache_file="$HOME/.cache/current_wallpaper"
clear
echo "Update the background wallpaper of sddm to the current wallpaper."
echo ""
@@ -20,10 +21,15 @@ fi
sudo cp sddm.conf /etc/sddm.conf.d/
echo "File /etc/sddm.conf.d/sddm.conf updated."
sudo cp ~/.cache/current_wallpaper.jpg /usr/share/sddm/themes/sugar-candy/Backgrounds/
echo "Current wallpaper copied into /usr/share/sddm/themes/sugar-candy/Backgrounds/"
current_wallpaper=$(cat "$cache_file")
extension="${current_wallpaper##*.}"
sudo cp $current_wallpaper /usr/share/sddm/themes/sugar-candy/Backgrounds/current_wallpaper.$extension
echo "Current wallpaper copied into /usr/share/sddm/themes/sugar-candy/Backgrounds/"
new_wall=$(echo $current_wallpaper | sed "s|$HOME/wallpaper/||g")
sudo cp theme.conf /usr/share/sddm/themes/sugar-candy/
sudo sed -i 's/CURRENTWALLPAPER/'"current_wallpaper.$extension"'/' /usr/share/sddm/themes/sugar-candy/theme.conf
echo "File theme.conf updated in /usr/share/sddm/themes/sugar-candy/"
echo ""