feat: UwUify

This commit is contained in:
Ninjdai 2024-05-15 10:40:12 +02:00
parent 10577951d8
commit 03c0e411cf
2 changed files with 70 additions and 0 deletions

70
UwUify.sh Normal file
View File

@ -0,0 +1,70 @@
#!/bin/bash
TMPDIR=/tmp/uwu/
TMPFILE="$TMPDIR/save.tmp"
WPNAME="wallpaper.jpg"
TMPWP="/tmp/uwu/$WPNAME"
WPURL="https://git.ninjdai.ynh.fr/ninjdai/install-scripts/src/branch/main/assets/$WPNAME"
function main ()
{
if [ "$EUID" -eq 0 ]
then echo -e "${C_RED}Script cannot be run as root !${NO_FORMAT}"
exit
fi
mkdir -p "$TMPDIR"
check_wget
if [ -f "$TMPFILE" ]; then
echo "$TMPFILE already exists, skipping config save..."
else
touch $TMPFILE
save_color_scheme
save_wallpaper
fi
set_color_scheme
download_wallpaper
set_wallpaper
}
check_wget ()
{
if ! command -v "wget" > /dev/null;
then
echo "wget is required to use the script"
exit
fi
}
download_wallpaper()
{
wget -q --show-progress "$WPURL" -P /tmp/uwu/
}
save_color_scheme ()
{
echo "primary-color=$(gsettings get org.gnome.desktop.background primary-color)" >> $TMPFILE
echo "secondary-color=$(gsettings get org.gnome.desktop.background secondary-color)" >> $TMPFILE
}
set_color_scheme ()
{
gsettings set org.gnome.desktop.background primary-color "#d910c5"
gsettings set org.gnome.desktop.background secondary-color "#de52d0"
}
save_wallpaper ()
{
echo "picture-uri=$(gsettings get org.gnome.desktop.background picture-uri)" >> $TMPFILE
echo "picture-uri-dark=$(gsettings get org.gnome.desktop.background picture-uri-dark)" >> $TMPFILE
}
set_wallpaper ()
{
gsettings set org.gnome.desktop.background picture-uri "file://${TMPWP}"
gsettings set org.gnome.desktop.background picture-uri-dark "file://${TMPWP}"
}
main

BIN
assets/wallpaper.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 KiB