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,7 @@
#!/bin/bash
_getHeader "$name" "$author"
echo "$homepage ($email)"
echo "ML4W dotfiles Version 2.7"
echo "Settings Version" $(_getVersion)
echo ""
echo $description

View File

@@ -2,6 +2,9 @@
_getHeader "$name" "$author"
if gum confirm "Do you want to update the SDDM background with the current wallpaper?" ;then
cache_file="$HOME/.cache/current_wallpaper"
if [ ! -d /etc/sddm.conf.d/ ]; then
sudo mkdir /etc/sddm.conf.d
echo "Folder /etc/sddm.conf.d created."
@@ -10,11 +13,15 @@ if gum confirm "Do you want to update the SDDM background with the current wallp
sudo cp ~/dotfiles/sddm/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 ~/dotfiles/sddm/theme.conf /usr/share/sddm/themes/sugar-candy/
echo "File theme.conf updated in /usr/share/sddm/themes/sugar-candy/"
sudo sed -i 's/CURRENTWALLPAPER/'"current_wallpaper.$extension"'/' /usr/share/sddm/themes/sugar-candy/theme.conf
echo ""
echo "SDDM background successfully updated!"