From be179c32b1cb3c7dba68a82e0bffe1d128d549cc Mon Sep 17 00:00:00 2001 From: GavinL2001 Date: Sun, 4 Feb 2024 18:48:24 -0600 Subject: [PATCH] Add initial swaybg support. --- install-scripts/swaybg.sh | 44 +++++++++++++++++++++++++++++++++++++++ install-scripts/swww.sh | 2 +- install.sh | 10 ++++++++- 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 install-scripts/swaybg.sh diff --git a/install-scripts/swaybg.sh b/install-scripts/swaybg.sh new file mode 100644 index 0000000..02161c8 --- /dev/null +++ b/install-scripts/swaybg.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Swaybg - Static Wallpaper Utility # + +swaybg=( +swaybg +libc6 +libcairo2 +libglib2.0-0 +libwayland-client0 +) + +## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## +# Determine the directory where the script is located +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Change the working directory to the parent directory of the script +PARENT_DIR="$SCRIPT_DIR/.." +cd "$PARENT_DIR" || exit 1 + +source "$(dirname "$(readlink -f "$0")")/Global_functions.sh" + +# Set the name of the log file to include the current date and time +LOG="Install-Logs/install-$(date +%d-%H%M%S)_swaybg2.log" +MLOG="install-$(date +%d-%H%M%S)_swaybg.log" + +printf "${NOTE} Installing swaybg\n" + for SWAYBG in "${swaybg[@]}"; do + install_package "$SWAYBG" 2>&1 | tee -a "$LOG" + [ $? -ne 0 ] && { echo -e "\e[1A\e[K${ERROR} - $SWAYBG install had failed, please check the install.log"; exit 1; } + done + + # Check for existing configs and copy if does not exist +for DIR1 in swaybg; do + DIRPATH=~/.config/$DIR1 + if [ -d "$DIRPATH" ]; then + echo -e "${NOTE} Config for $DIR1 found, no need to copy." 2>&1 | tee -a "$LOG" + else + echo -e "${NOTE} Config for $DIR1 not found, copying from assets." 2>&1 | tee -a "$LOG" + cp -r assets/$DIR1 ~/.config/ && echo "Copy $DIR1 completed!" || echo "Error: Failed to copy $DIR1 config files." 2>&1 | tee -a "$LOG" + fi +done + +clear diff --git a/install-scripts/swww.sh b/install-scripts/swww.sh index d927ddb..44e5793 100755 --- a/install-scripts/swww.sh +++ b/install-scripts/swww.sh @@ -1,6 +1,6 @@ #!/bin/bash # 💫 https://github.com/JaKooLit 💫 # -# SWWW - Wallpaper Utility # +# SWWW - Dynamic Wallpaper Utility # ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## # Determine the directory where the script is located diff --git a/install.sh b/install.sh index f71d227..15180ae 100755 --- a/install.sh +++ b/install.sh @@ -82,6 +82,7 @@ rog="" sddm="" swaylock="" thunar="" +wallpaper="" xdph="" zsh="" @@ -150,6 +151,8 @@ ask_yes_no "-Install zsh & oh-my-zsh plus (OPTIONAL) pokemon-colorscripts for tt printf "\n" ask_yes_no "-Install swaylock-effects? (recommended - for screen locks)" swaylock printf "\n" +ask_custom_option "-Do you want swaybg (1) for static wallpapers, or swww (2) for animated wallpapers?" wallpaper +printf "\n" ask_yes_no "-Install nwg-look? (a GTK Theming app - lxappearance-like) WARN! This Package Takes long time to build!" nwg printf "\n" ask_yes_no "-Installing on Asus ROG Laptops?" rog @@ -167,7 +170,6 @@ execute_script "00-dependencies.sh" execute_script "00-hypr-pkgs.sh" execute_script "fonts.sh" execute_script "swappy.sh" -execute_script "swww.sh" execute_script "rofi-wayland.sh" execute_script "pywal.sh" execute_script "force-install.sh" @@ -211,6 +213,12 @@ if [ "$swaylock" == "Y" ]; then execute_script "swaylock-effects.sh" fi +if [ "$wallpaper" == "1" ]; then + execute_script "swaybg.sh" + elif [ "$wallpaper" == "2" ] + execute_script "swww.sh" +fi + if [ "$nwg" == "Y" ]; then execute_script "nwg-look.sh" fi