Files
dotfiles/user/.chezmoiscripts/run_onchange_after_install-spicetify-theme.sh.tmpl
T

38 lines
1.2 KiB
Cheetah

#!/usr/bin/bash
# This script is skipped if no spicetify-cli is available or no spotify is installed
if ! command -v spicetify > /dev/null; then
echo "Skipping Spotify Theming, no spicetify-cli available"
exit 0
fi
if [ ! -d "/opt/spotify" ]; then
echo "Skipping Spotify Theming, no spotify found at /opt/spotify"
exit 0
fi
# Apply theme to spotify if either the spotify binary has changed, or the theme was updated in github
# spotify hash: {{ include "/opt/spotify/spotify" | sha256sum }}
# catppuccin hash: {{ joinPath .chezmoi.homeDir ".config/spicetify-catppuccin-theme/catppuccin/app.scss" | include | sha256sum }}
mkdir -p ~/.config/spicetify/Themes
cp -r ~/.config/spicetify-catppuccin-theme/catppuccin ~/.config/spicetify/Themes/
getent group spotify > /dev/null || {
echo "System group spotify is missing"
echo "Please create it with groupadd -r spotify"
echo "Then re-login and try again"
exit 1
}
sudo chgrp spotify /opt/spotify
sudo chgrp -R spotify /opt/spotify/Apps
sudo chmod 775 /opt/spotify
sudo chmod 775 -R /opt/spotify/Apps
spicetify backup
spicetify config current_theme catppuccin
spicetify config color_scheme mocha
spicetify config inject_css 1 inject_theme_js 1 replace_colors 1 overwrite_assets 1
spicetify apply