Skip to content

Commit

Permalink
Fixed gnome-shell 42 issues #49 #39
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceliuice committed Apr 22, 2022
1 parent 519c2c9 commit 54d3356
Show file tree
Hide file tree
Showing 46 changed files with 444 additions and 66,488 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
*-temp.scss
src/main/cinnamon/cinnamon-light.css
src/main/cinnamon/cinnamon-dark.css
src/main/gnome-shell/gnome-shell-dark.css
src/main/gnome-shell/gnome-shell-light.css
src/main/gnome-shell/gnome-shell.css
src/main/gtk-3.0/gtk-dark.css
src/main/gtk-3.0/gtk.css
src/main/gtk-4.0/gtk-light.css
src/main/gtk-4.0/gtk.css
src/main/gtk-4.0/gtk-dark.css
src/main/gtk-3.0/gtk-light.css
7 changes: 3 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ if [ ! -z "${COLOR_VARIANTS:-}" ]; then
fi

cp -rf src/sass/_tweaks.scss src/sass/_tweaks-temp.scss
cp -rf src/sass/gnome-shell/_common.scss src/sass/gnome-shell/_common-temp.scss

for color in "${_COLOR_VARIANTS[@]}"; do
sassc $SASSC_OPT src/main/gtk-3.0/gtk${color}.{scss,css}
echo "==> Generating the 3.0 gtk${color}.css..."
sassc $SASSC_OPT src/main/gtk-4.0/gtk${color}.{scss,css}
echo "==> Generating the 4.0 gtk${color}.css..."
sassc $SASSC_OPT src/main/gnome-shell/shell-3-28/gnome-shell${color}.{scss,css}
echo "==> Generating the 3.28 gnome-shell${color}.css..."
sassc $SASSC_OPT src/main/gnome-shell/shell-40-0/gnome-shell${color}.{scss,css}
echo "==> Generating the 40.0 gnome-shell${color}.css..."
sassc $SASSC_OPT src/main/gnome-shell/gnome-shell${color}.{scss,css}
echo "==> Generating the gnome-shell${color}.css..."
sassc $SASSC_OPT src/main/cinnamon/cinnamon${color}.{scss,css}
echo "==> Generating the cinnamon${color}.css..."
done
79 changes: 32 additions & 47 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,19 @@ SIZE_VARIANTS=('' '-compact')

if [[ "$(command -v gnome-shell)" ]]; then
SHELL_VERSION="$(gnome-shell --version | cut -d ' ' -f 3 | cut -d . -f -1)"
if [[ "${SHELL_VERSION:-}" -ge "40" ]]; then
GS_VERSION="new"
if [[ "${SHELL_VERSION:-}" -ge "42" ]]; then
GS_VERSION="42"
echo "gnome-shell 42"
elif [[ "${SHELL_VERSION:-}" -ge "40" ]]; then
GS_VERSION="40"
echo "gnome-shell 40"
else
GS_VERSION="old"
GS_VERSION="38"
echo "gnome-shell 38"
fi
else
echo "'gnome-shell' not found, using styles for last gnome-shell version available."
GS_VERSION="new"
GS_VERSION="42"
fi

usage() {
Expand Down Expand Up @@ -102,20 +107,7 @@ install() {

mkdir -p "${THEME_DIR}/gnome-shell"
cp -r "${SRC_DIR}/main/gnome-shell/pad-osd.css" "${THEME_DIR}/gnome-shell"

if [[ "$tweaks" == 'true' ]]; then
if [[ "${GS_VERSION:-}" == 'new' ]]; then
sassc $SASSC_OPT "${SRC_DIR}/main/gnome-shell/shell-40-0/gnome-shell${color}.scss" "${THEME_DIR}/gnome-shell/gnome-shell.css"
else
sassc $SASSC_OPT "${SRC_DIR}/main/gnome-shell/shell-3-28/gnome-shell${color}.scss" "${THEME_DIR}/gnome-shell/gnome-shell.css"
fi
else
if [[ "${GS_VERSION:-}" == 'new' ]]; then
cp -r "${SRC_DIR}/main/gnome-shell/shell-40-0/gnome-shell${color}.css" "${THEME_DIR}/gnome-shell/gnome-shell.css"
else
cp -r "${SRC_DIR}/main/gnome-shell/shell-3-28/gnome-shell${color}.css" "${THEME_DIR}/gnome-shell/gnome-shell.css"
fi
fi
sassc $SASSC_OPT "${SRC_DIR}/main/gnome-shell/gnome-shell${color}.scss" "${THEME_DIR}/gnome-shell/gnome-shell.css"

cp -r "${SRC_DIR}/assets/gnome-shell/common-assets" "${THEME_DIR}/gnome-shell/assets"
cp -r "${SRC_DIR}/assets/gnome-shell/assets${ELSE_DARK:-}/"*.svg "${THEME_DIR}/gnome-shell/assets"
Expand All @@ -136,39 +128,28 @@ install() {
cp -r "${SRC_DIR}/assets/gtk/assets${theme}${ctype}" "${THEME_DIR}/gtk-3.0/assets"
cp -r "${SRC_DIR}/assets/gtk/scalable" "${THEME_DIR}/gtk-3.0/assets"
cp -r "${SRC_DIR}/assets/gtk/thumbnails/thumbnail${theme}${ctype}${ELSE_DARK:-}.png" "${THEME_DIR}/gtk-3.0/thumbnail.png"

if [[ "$tweaks" == 'true' ]]; then
sassc $SASSC_OPT "${SRC_DIR}/main/gtk-3.0/gtk${color}.scss" "${THEME_DIR}/gtk-3.0/gtk.css"
sassc $SASSC_OPT "${SRC_DIR}/main/gtk-3.0/gtk-dark.scss" "${THEME_DIR}/gtk-3.0/gtk-dark.css"
else
cp -r "${SRC_DIR}/main/gtk-3.0/gtk${color}.css" "${THEME_DIR}/gtk-3.0/gtk.css"
cp -r "${SRC_DIR}/main/gtk-3.0/gtk-dark.css" "${THEME_DIR}/gtk-3.0"
fi
sassc $SASSC_OPT "${SRC_DIR}/main/gtk-3.0/gtk${color}.scss" "${THEME_DIR}/gtk-3.0/gtk.css"
sassc $SASSC_OPT "${SRC_DIR}/main/gtk-3.0/gtk-dark.scss" "${THEME_DIR}/gtk-3.0/gtk-dark.css"

mkdir -p "${THEME_DIR}/gtk-4.0"
cp -r "${SRC_DIR}/assets/gtk/assets${theme}${ctype}" "${THEME_DIR}/gtk-4.0/assets"
cp -r "${SRC_DIR}/assets/gtk/scalable" "${THEME_DIR}/gtk-4.0/assets"
cp -r "${SRC_DIR}/assets/gtk/thumbnails/thumbnail${theme}${ctype}${ELSE_DARK:-}.png" "${THEME_DIR}/gtk-4.0/thumbnail.png"
sassc $SASSC_OPT "${SRC_DIR}/main/gtk-4.0/gtk${color}.scss" "${THEME_DIR}/gtk-4.0/gtk.css"
sassc $SASSC_OPT "${SRC_DIR}/main/gtk-4.0/gtk-dark.scss" "${THEME_DIR}/gtk-4.0/gtk-dark.css"

if [[ "$tweaks" == 'true' ]]; then
sassc $SASSC_OPT "${SRC_DIR}/main/gtk-4.0/gtk${color}.scss" "${THEME_DIR}/gtk-4.0/gtk.css"
sassc $SASSC_OPT "${SRC_DIR}/main/gtk-4.0/gtk-dark.scss" "${THEME_DIR}/gtk-4.0/gtk-dark.css"
else
cp -r "${SRC_DIR}/main/gtk-4.0/gtk${color}.css" "${THEME_DIR}/gtk-4.0/gtk.css"
cp -r "${SRC_DIR}/main/gtk-4.0/gtk-dark.css" "${THEME_DIR}/gtk-4.0"
fi
# link gtk4.0 for libadwaita
mkdir -p "${HOME}/.config/gtk-4.0"
rm -rf "${HOME}/.config/gtk-4.0/"{assets,gtk.css,gtk-dark.css}
ln -sf "${THEME_DIR}/gtk-4.0/assets" "${HOME}/.config/gtk-4.0/assets"
ln -sf "${THEME_DIR}/gtk-4.0/gtk.css" "${HOME}/.config/gtk-4.0/gtk.css"
ln -sf "${THEME_DIR}/gtk-4.0/gtk-dark.css" "${HOME}/.config/gtk-4.0/gtk-dark.css"

mkdir -p "${THEME_DIR}/cinnamon"
cp -r "${SRC_DIR}/assets/cinnamon/common-assets" "${THEME_DIR}/cinnamon/assets"
cp -r "${SRC_DIR}/assets/cinnamon/assets${ELSE_DARK:-}/"*'.svg' "${THEME_DIR}/cinnamon/assets"
cp -r "${SRC_DIR}/assets/cinnamon/theme${theme}${ctype}/"*'.svg' "${THEME_DIR}/cinnamon/assets"

if [[ "$tweaks" == 'true' ]]; then
sassc $SASSC_OPT "${SRC_DIR}/main/cinnamon/cinnamon${color}.scss" "${THEME_DIR}/cinnamon/cinnamon.css"
else
cp -r "${SRC_DIR}/main/cinnamon/cinnamon${color}.css" "${THEME_DIR}/cinnamon/cinnamon.css"
fi

sassc $SASSC_OPT "${SRC_DIR}/main/cinnamon/cinnamon${color}.scss" "${THEME_DIR}/cinnamon/cinnamon.css"
cp -r "${SRC_DIR}/assets/cinnamon/thumbnails/thumbnail${theme}${ctype}${color}.png" "${THEME_DIR}/cinnamon/thumbnail.png"

mkdir -p "${THEME_DIR}/metacity-1"
Expand Down Expand Up @@ -412,7 +393,8 @@ install_package() {
fi
}

tweaks_temp() {
sass_temp() {
cp -rf ${SRC_DIR}/sass/gnome-shell/_common.scss ${SRC_DIR}/sass/gnome-shell/_common-temp.scss
cp -rf ${SRC_DIR}/sass/_tweaks.scss ${SRC_DIR}/sass/_tweaks-temp.scss
}

Expand Down Expand Up @@ -442,6 +424,14 @@ normal_winbutton() {
sed -i "/\$window_button:/s/mac/normal/" ${SRC_DIR}/sass/_tweaks-temp.scss
}

gnome_shell_version() {
sed -i "/\widgets/s/40/${GS_VERSION}/" ${SRC_DIR}/sass/gnome-shell/_common-temp.scss

if [[ "${GS_VERSION}" == '38' ]]; then
sed -i "/\extensions/s/40-0/3-28/" ${SRC_DIR}/sass/gnome-shell/_common-temp.scss
fi
}

theme_color() {
if [[ "$theme" != '' ]]; then
case "$theme" in
Expand Down Expand Up @@ -475,11 +465,6 @@ theme_color() {
}

theme_tweaks() {
if [[ "$accent" == 'true' || "$compact" == 'true' || "$nord" == 'true' || "$dracula" == 'true' || "$rimless" == 'true' || "$blackness" == 'true' || "$normal" == 'true' ]]; then
tweaks='true'
install_package; tweaks_temp
fi

if [[ "$accent" = "true" ]] ; then
theme_color
fi
Expand Down Expand Up @@ -524,7 +509,7 @@ install_theme() {
fi
}

install_theme
install_package && sass_temp && gnome_shell_version && install_theme

echo
echo Done.
Loading

0 comments on commit 54d3356

Please sign in to comment.