Don Williams 29e8044170 Moved source and builds to build dir
Cleanup is now just removing the build directory and install-logs

 On branch development
 Your branch is up to date with 'origin/development'.

 Changes to be committed:
	modified:   install-scripts/Global_functions.sh
	modified:   install-scripts/ags.sh
	modified:   install-scripts/aquamarine.sh
	modified:   install-scripts/dotfiles-branch.sh
	modified:   install-scripts/gtk_themes.sh
	modified:   install-scripts/hyprcursor.sh
	modified:   install-scripts/hyprgraphics.sh
	modified:   install-scripts/hypridle.sh
	modified:   install-scripts/hyprland-guiutils.sh
	modified:   install-scripts/hyprland-protocols.sh
	modified:   install-scripts/hyprland-qt-support.sh
	modified:   install-scripts/hyprland.sh
	modified:   install-scripts/hyprlang.sh
	modified:   install-scripts/hyprlock.sh
	modified:   install-scripts/hyprpolkitagent.sh
	modified:   install-scripts/hyprtoolkit.sh
	modified:   install-scripts/hyprutils.sh
	modified:   install-scripts/hyprwayland-scanner.sh
	modified:   install-scripts/hyprwire.sh
	modified:   install-scripts/quickshell.sh
	modified:   install-scripts/rofi-wayland.sh
	modified:   install-scripts/rog.sh
	modified:   install-scripts/sddm_theme.sh
	modified:   install-scripts/swww.sh
	modified:   install-scripts/wayland-protocols-src.sh
	modified:   install-scripts/xdph.sh
	modified:   install-scripts/xkbcommon.sh
	modified:   install-scripts/zsh_pokemon.sh
2026-01-23 19:18:26 -05:00

102 lines
2.9 KiB
Bash
Executable File

#!/bin/bash
# 💫 https://github.com/JaKooLit 💫 #
# SWWW - Wallpaper Utility #
# specific branch or release
swww_tag="v0.11.2"
# Check if 'swww' is installed
if command -v swww &>/dev/null; then
SWWW_VERSION=$(swww -V | awk '{print $NF}')
if [[ "$SWWW_VERSION" == "$swww_tag" ]]; then
echo -e "${OK} ${MAGENTA}swww ${swww_tag}${RESET} is already installed. Skipping installation."
exit 0
fi
else
echo -e "${NOTE} ${MAGENTA}swww${RESET} is not installed. Proceeding with installation."
fi
swww=(
liblz4-dev
)
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
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" || {
echo "${ERROR} Failed to change directory to $PARENT_DIR"
exit 1
}
# Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then
echo "Failed to source Global_functions.sh"
exit 1
fi
# Set the name of the log file to include the current date and time
LOG="Install-Logs/install-$(date +%d-%H%M%S)_swww.log"
MLOG="install-$(date +%d-%H%M%S)_swww2.log"
# Installation of swww compilation needed
printf "\n%s - Installing ${SKY_BLUE}swww $swww_tag and dependencies${RESET} .... \n" "${NOTE}"
for PKG1 in "${swww[@]}"; do
install_package "$PKG1" "$LOG"
done
printf "\n%.0s" {1..2}
# Check if swww directory exists (under build/src)
SRC_DIR="$SRC_ROOT/swww"
if [ -d "$SRC_DIR" ]; then
cd "$SRC_DIR" || exit 1
git pull origin main 2>&1 | tee -a "$MLOG"
else
if git clone --recursive -b $swww_tag https://github.com/LGFae/swww.git "$SRC_DIR"; then
cd "$SRC_DIR" || exit 1
else
echo -e "${ERROR} Download failed for ${YELLOW}swww $swww_tag${RESET}" 2>&1 | tee -a "$LOG"
exit 1
fi
fi
# Proceed with the rest of the installation steps
source "$HOME/.cargo/env" || true
cargo build --release 2>&1 | tee -a "$MLOG"
# Checking if swww is previously installed and delete before copying
file1="/usr/bin/swww"
file2="/usr/bin/swww-daemon"
# Check if file1 exists and delete if so
if [ -f "$file1" ]; then
sudo rm -r "$file1"
fi
# Check if file2 exists and delete if so
if [ -f "$file2" ]; then
sudo rm -r "$file2"
fi
# Copy binaries to /usr/bin/
sudo cp -r target/release/swww /usr/bin/ 2>&1 | tee -a "$MLOG"
sudo cp -r target/release/swww-daemon /usr/bin/ 2>&1 | tee -a "$MLOG"
# Copy bash completions
sudo mkdir -p /usr/share/bash-completion/completions 2>&1 | tee -a "$MLOG"
sudo cp -r completions/swww.bash /usr/share/bash-completion/completions/swww 2>&1 | tee -a "$MLOG"
# Copy zsh completions
sudo mkdir -p /usr/share/zsh/site-functions 2>&1 | tee -a "$MLOG"
sudo cp -r completions/_swww /usr/share/zsh/site-functions/_swww 2>&1 | tee -a "$MLOG"
# Moving logs into main Install-Logs
mv "$MLOG" "$PARENT_DIR/Install-Logs/" || true
cd - || exit 1
printf "\n%.0s" {1..2}