wallpaper image file support
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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!"
|
||||
|
||||
Reference in New Issue
Block a user