Files
WhiteSur-gtk-theme/other/gdm/parse-sass.sh
vinceliuice 72d4939372 update
2025-08-05 18:45:52 +08:00

35 lines
878 B
Bash
Executable File

#! /usr/bin/env bash
# Check command availability
function has_command() {
command -v $1 > /dev/null
}
if [ ! "$(which sassc 2> /dev/null)" ]; then
echo sassc needs to be installed to generate the css.
if has_command zypper; then
sudo zypper in sassc
elif has_command apt; then
sudo apt install -y sassc
elif has_command dnf; then
sudo dnf install -y sassc
elif has_command yum; then
sudo yum install -y sassc
elif has_command pacman; then
sudo pacman -S --noconfirm sassc
fi
fi
SASSC_OPT="-M -t expanded"
_COLOR_VARIANTS=('-light' '-dark' '-high-contrast')
if [ ! -z "${COLOR_VARIANTS:-}" ]; then
IFS=', ' read -r -a _COLOR_VARIANTS <<< "${COLOR_VARIANTS:-}"
fi
for color in "${_COLOR_VARIANTS[@]}"; do
sassc $SASSC_OPT gnome-shell${color}.scss theme/gnome-shell${color}.css
echo "==> Generating gnome-shell${color}.css..."
done