#!/usr/bin/env bash # Function to set permissions for Spotify path set_permissions() { local path=$1 chmod a+wr "$path" chmod a+wr -R "$path/Apps" } # Function to notify and set permissions using pkexec notify_and_set_permissions() { local path=$1 notify-send -a "HyDE Alert" "Permission needed for Wallbash Spotify theme" pkexec chmod a+wr "$path" pkexec chmod a+wr -R "$path/Apps" } # Function to configure Spicetify configure_spicetify() { local spotify_path=$1 local cache_dir=$2 local spotify_flags='--ozone-platform=wayland' local spotify_conf spicetify &>/dev/null mkdir -p ~/.config/spotify touch ~/.config/spotify/prefs spotify_conf=$(spicetify -c) sed -i -e "/^prefs_path/ s+=.*$+= $HOME/.config/spotify/prefs+g" \ -e "/^spotify_path/ s+=.*$+= $spotify_path+g" \ -e "/^spotify_launch_flags/ s+=.*$+= $spotify_flags+g" "$spotify_conf" spicetify_themes_dir="$HOME/.config/spicetify/Themes" if [ ! -d "${spicetify_themes_dir}/Sleek" ]; then curl -L -o "${cache_dir}/landing/Spotify_Sleek.tar.gz" "https://github.com/HyDE-Project/HyDE/raw/master/Source/arcs/Spotify_Sleek.tar.gz" tar -xzf "${cache_dir}/landing/Spotify_Sleek.tar.gz" -C "$spicetify_themes_dir" fi spicetify backup apply spicetify config current_theme Sleek spicetify config color_scheme Wallbash spicetify config sidebar_config 0 spicetify restore backup spicetify backup apply } # Main script cacheDir="${cacheDir:-$XDG_CACHE_HOME/hyde}" shareDir=${XDG_DATA_HOME:-$HOME/.local/share} if [ -n "${SPOTIFY_PATH}" ]; then spotify_path="${SPOTIFY_PATH}" cat </dev/null; then pkill -x spicetify spicetify -q watch -s & disown fi fi