diff --git a/.gitignore b/.gitignore index 094f594..87df1ff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ .DS_store .sass-cache -_theme-options-temp.scss -_gtk-base-temp.scss +*-temp.scss *.css.map src/main/gtk-3.0/gtk*.css src/main/gtk-4.0/gtk*.css diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a735a62..5b6b4f5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,9 +2,7 @@ ## Summary -- Do not edit the CSS directly, edit the source SCSS files and process them with SASS (run - `./parse-sass.sh` when you have the required software installed, as described below) -- To be able to use the latest/adequate version of sass, install sassc. +To be able to use the latest/adequate version of sass, install sassc. ## How to tweak the theme diff --git a/clean-git.sh b/clean-git.sh index 4449e90..7c3a88a 100755 --- a/clean-git.sh +++ b/clean-git.sh @@ -3,5 +3,7 @@ # Clean ignored files # +# TODO: integrate with Bridge.sh + git clean -d -f -X git add . diff --git a/install.sh b/install.sh index 0116f60..b14f792 100755 --- a/install.sh +++ b/install.sh @@ -18,7 +18,6 @@ source "${REPO_DIR}/lib-install.sh" # Customization, default values colors=("${COLOR_VARIANTS[@]}") opacities=("${OPACITY_VARIANTS[@]}") -background="blank" usage() { # Please specify their default value manually, some of them are come from _variables.scss @@ -33,6 +32,7 @@ usage() { helpify "-p, --panel" "[$(IFS='|'; echo "${PANEL_OPACITY_VARIANTS[*]}")]" "Set panel transparency" "Default is 15%" helpify "-s, --size" "[$(IFS='|'; echo "${SIDEBAR_SIZE_VARIANTS[*]}")]" "Set Nautilus sidebar minimum width" "Default is 200px" helpify "-i, --icon" "[$(IFS='|'; echo "${ICON_VARIANTS[*]}")]" "Set 'Activities' icon" "Default is 'standard'" + # Not sure if "background" is even needed here helpify "-b, --background" "[default|blank|IMAGE_PATH]" "Set gnome-shell background image" "Default is BigSur-like wallpaper" helpify "-HD, --highdefinition" "" "Set to High Definition size" "Default is laptop size" helpify "--normal, --normalshowapps" "" "Set gnome-shell show apps button style to normal" "Default is bigsur" diff --git a/lib-install.sh b/lib-install.sh index ef64c8a..09bc381 100755 --- a/lib-install.sh +++ b/lib-install.sh @@ -25,7 +25,7 @@ source "${REPO_DIR}/lib-core.sh" install_theme_deps() { if ! has_command glib-compile-resources || ! has_command sassc || \ ! has_command xmllint || [[ ! -r "/usr/share/gtk-engines/murrine.xml" ]]; then - echo; prompt -w "'glib2.0', 'sassc', 'xmllint', 'libmurrine' are required for theme installation." + echo; prompt -w "'glib2.0', 'sassc', 'xmllint', and 'libmurrine' are required for theme installation." if has_command zypper; then rootify zypper in -y sassc glib2-devel gtk2-engine-murrine libxml2-tools @@ -47,46 +47,34 @@ install_theme_deps() { } install_gdm_deps() { - if [[ ! "$(which glib-compile-resources 2> /dev/null)" || ! "$(which xmllint 2> /dev/null)" ]]; then - echo; prompt -w "'glib2.0' 'xmllint' are required for theme installation." + #TODO: @vince, do we also need "sassc" here? + + if ! has_command glib-compile-resources || ! has_command xmllint || \ + ! has_command sassc; then + echo; prompt -w "'glib2.0', 'xmllint', and 'sassc' are required for theme installation." if has_command zypper; then - rootify zypper in -y glib2-devel libxml2-tools + rootify zypper in -y glib2-devel libxml2-tools sassc elif has_command apt; then - rootify apt install -y libglib2.0-dev-bin libxml2-utils + rootify apt install -y libglib2.0-dev-bin libxml2-utils sassc elif has_command dnf; then - rootify dnf install -y glib2-devel libxml2 + rootify dnf install -y glib2-devel libxml2 sassc elif has_command yum; then - rootify yum install -y glib2-devel libxml2 + rootify yum install -y glib2-devel libxml2 sassc elif has_command pacman; then - rootify pacman -S --noconfirm --needed glib2 libxml2 + rootify pacman -S --noconfirm --needed glib2 libxml2 sassc else - prompt -w "INSTRUCTION: Please make sure you have installed all of the required dependencies!" + prompt -w "WARNING: We're sorry, your distro isn't officially supported yet." + prompt -w "INSTRUCTION: Please make sure you have installed all of the required dependencies. We'll continue the installation in 15 seconds" + prompt -w "INSTRUCTION: Press 'ctrl'+'c' to cancel the installation if you haven't install them yet" + start_animation; sleep 15; stop_animation fi fi } install_beggy_deps() { - if ! has_command sassc; then - echo; prompt -w "'sassc' are required for this option." - - if has_command zypper; then - rootify zypper in -y sassc - elif has_command apt; then - rootify apt install -y sassc - elif has_command dnf; then - rootify dnf install -y sassc - elif has_command yum; then - rootify yum install -y sassc - elif has_command pacman; then - rootify pacman -S --noconfirm --needed sassc - else - prompt -w "INSTRUCTION: Please make sure you have installed all of the required dependencies!" - fi - fi - if ! has_command convert; then - echo; prompt -w "'imagemagick' are required for this option." + echo; prompt -w "'imagemagick' are required for background editing." if has_command zypper; then rootify zypper in -y ImageMagick @@ -99,7 +87,10 @@ install_beggy_deps() { elif has_command pacman; then rootify pacman -S --noconfirm --needed imagemagick else - prompt -w "INSTRUCTION: Please make sure you have installed all of the required dependencies!" + prompt -w "WARNING: We're sorry, your distro isn't officially supported yet." + prompt -w "INSTRUCTION: Please make sure you have installed all of the required dependencies. We'll continue the installation in 15 seconds" + prompt -w "INSTRUCTION: Press 'ctrl'+'c' to cancel the installation if you haven't install them yet" + start_animation; sleep 15; stop_animation fi fi } @@ -119,7 +110,10 @@ install_dialog_deps() { elif has_command pacman; then rootify pacman -S --noconfirm --needed dialog else - prompt -w "INSTRUCTION: Please make sure you have installed all of the required dependencies!" + prompt -w "WARNING: We're sorry, your distro isn't officially supported yet." + prompt -w "INSTRUCTION: Please make sure you have installed all of the required dependencies. We'll continue the installation in 15 seconds" + prompt -w "INSTRUCTION: Press 'ctrl'+'c' to cancel the installation if you haven't install them yet" + start_animation; sleep 15; stop_animation fi fi } @@ -138,12 +132,14 @@ install_beggy() { blank) cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-blank.png" "${WHITESUR_TMP_DIR}/beggy.png" ;; default) - if [[ "${no_blur}" == "false" || "${darken}" == "true" ]]; then - install_beggy_deps && convert "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-default.png" ${CONVERT_OPT} "${WHITESUR_TMP_DIR}/beggy.png" + if [[ "${no_blur}" == "false" && "${darken}" == "false" ]]; then + cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-blur.png" "${WHITESUR_TMP_DIR}/beggy.png" elif [[ "${no_blur}" == "false" && "${darken}" == "true" ]]; then - cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-blur.png" "${WHITESUR_TMP_DIR}/beggy.png" + cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-blur-darken.png" "${WHITESUR_TMP_DIR}/beggy.png" + elif [[ "${no_blur}" == "true" && "${darken}" == "false" ]]; then + cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-default.png" "${WHITESUR_TMP_DIR}/beggy.png" else - cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-default.png" "${WHITESUR_TMP_DIR}/beggy.png" + cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-darken.png" "${WHITESUR_TMP_DIR}/beggy.png" fi ;; *) @@ -156,19 +152,6 @@ install_beggy() { esac } -install_beggy_blur() { - local CONVERT_OPT=" -scale 1280x -blur 0x35 -fill black -colorize 25% " - - case "${background}" in - blank) - cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-blank.png" "${WHITESUR_TMP_DIR}/beggy-blur.png" ;; - default) - cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-blur.png" "${WHITESUR_TMP_DIR}/beggy-blur.png" ;; - *) - install_beggy_deps && convert "${background}" ${CONVERT_OPT} "${WHITESUR_TMP_DIR}/beggy-blur.png" ;; - esac -} - install_darky() { local opacity="$(destify ${1})" local theme="$(destify ${2})" @@ -229,7 +212,6 @@ install_shelly() { cp -r "${THEME_SRC_DIR}/assets/gnome-shell/assets${color}/"*".svg" "${TARGET_DIR}/assets" cp -r "${THEME_SRC_DIR}/assets/gnome-shell/activities/activities${icon}.svg" "${TARGET_DIR}/assets/activities.svg" cp -r "${WHITESUR_TMP_DIR}/beggy.png" "${TARGET_DIR}/assets/background.png" - cp -r "${WHITESUR_TMP_DIR}/beggy-blur.png" "${TARGET_DIR}/assets/background-blur.png" ( cd "${TARGET_DIR}" @@ -357,11 +339,10 @@ remove_packy() { ############################################################################### install_themes() { - start_animation - process_ids=() - install_beggy - install_beggy_blur - cp -rf "${THEME_SRC_DIR}/sass/_gtk-base"{".scss","-temp.scss"} + # "install_theemy" and "install_shelly" require "gtk_base", so multithreading + # isn't possible + + start_animation; install_beggy for opacity in "${opacities[@]}"; do for alt in "${alts[@]}"; do @@ -369,21 +350,14 @@ install_themes() { install_xfwmy "${color}" for color in "${colors[@]}"; do - gtk_base "${color}" "${opacity}" "${theme}" "${compact}" & - process_ids+=("${!}") & - install_theemy "${color}" "${opacity}" "${alt}" "${theme}" "${icon}" & - process_ids+=("${!}") - - gtk_base "${color}" "${opacity}" "${theme}" "${compact}" & - process_ids+=("${!}") & - install_shelly "${color}" "${opacity}" "${alt}" "${theme}" "${icon}" & - process_ids+=("${!}") + gtk_base "${color}" "${opacity}" "${theme}" "${compact}" + install_theemy "${color}" "${opacity}" "${alt}" "${theme}" "${icon}" + install_shelly "${color}" "${opacity}" "${alt}" "${theme}" "${icon}" done done done done - wait ${process_ids[*]} &> /dev/null stop_animation } @@ -409,10 +383,10 @@ install_gdm_theme() { local TARGET= # Let's go! - rm -rf "${WHITESUR_GS_DIR}"; install_beggy; install_beggy_blur + rm -rf "${WHITESUR_GS_DIR}"; install_beggy + gtk_base "${colors[0]}" "${opacities[0]}" "${themes[0]}" if check_theme_file "${COMMON_CSS_FILE}"; then # CSS-based theme - gtk_base "${colors[0]}" "${opacities[0]}" "${themes[0]}" & install_shelly "${colors[0]}" "${opacities[0]}" "${alts[0]}" "${themes[0]}" "${icon}" "${WHITESUR_GS_DIR}" sed $SED_OPT "s|assets|${WHITESUR_GS_DIR}/assets|" "${WHITESUR_GS_DIR}/gnome-shell.css" @@ -429,11 +403,10 @@ install_gdm_theme() { # Fix previously installed WhiteSur restore_file "${ETC_CSS_FILE}" else # GR-based theme - gtk_base "${colors[0]}" "${opacities[0]}" "${themes[0]}" & install_shelly "${colors[0]}" "${opacities[0]}" "${alts[0]}" "${themes[0]}" "${icon}" "${WHITESUR_TMP_DIR}/shelly" sed $SED_OPT "s|assets|resource:///org/gnome/shell/theme/assets|" "${WHITESUR_TMP_DIR}/shelly/gnome-shell.css" - if check_theme_file "$POP_OS_GR_F & ILE"; then + if check_theme_file "$POP_OS_GR_FILE"; then TARGET="${POP_OS_GR_FILE}" elif check_theme_file "$YARU_GR_FILE"; then TARGET="${YARU_GR_FILE}" @@ -499,7 +472,8 @@ remove_firefox_theme() { ############################################################################### install_dash_to_dock_theme() { - cp -rf "${THEME_SRC_DIR}/sass/_gtk-base"{".scss","-temp.scss"} + gtk_base "${colors[0]}" "${opacities[0]}" "${themes[0]}" + if [[ -d "${DASH_TO_DOCK_DIR_HOME}" ]]; then backup_file "${DASH_TO_DOCK_DIR_HOME}/stylesheet.css" "userify" userify sassc ${SASSC_OPT} "${DASH_TO_DOCK_SRC_DIR}/stylesheet$(destify ${colors[0]}).scss" "${DASH_TO_DOCK_DIR_HOME}/stylesheet.css" @@ -575,7 +549,6 @@ gtk_base() { ############################################################################### customize_theme() { - rm -rf "${THEME_SRC_DIR}/sass/_theme-options-temp.scss" cp -rf "${THEME_SRC_DIR}/sass/_theme-options"{".scss","-temp.scss"} # Change gnome-shell panel transparency @@ -616,6 +589,7 @@ customize_theme() { if [[ "${compact}" == 'false' ]]; then prompt -s "Changing Definition mode to HD (Bigger font, Bigger size) ..." + #FIXME: @vince is it not implemented yet? fi } diff --git a/src/assets/gnome-shell/common-assets/background-blur-darken.png b/src/assets/gnome-shell/common-assets/background-blur-darken.png new file mode 100644 index 0000000..266ffed Binary files /dev/null and b/src/assets/gnome-shell/common-assets/background-blur-darken.png differ diff --git a/src/assets/gnome-shell/common-assets/background-blur.png b/src/assets/gnome-shell/common-assets/background-blur.png index f4ae73e..b71b275 100644 Binary files a/src/assets/gnome-shell/common-assets/background-blur.png and b/src/assets/gnome-shell/common-assets/background-blur.png differ diff --git a/src/assets/gnome-shell/common-assets/background-darken.png b/src/assets/gnome-shell/common-assets/background-darken.png new file mode 100644 index 0000000..04bf5be Binary files /dev/null and b/src/assets/gnome-shell/common-assets/background-darken.png differ diff --git a/src/main/gnome-shell/gnome-shell-theme.gresource.xml b/src/main/gnome-shell/gnome-shell-theme.gresource.xml index 81b973c..0a6771c 100644 --- a/src/main/gnome-shell/gnome-shell-theme.gresource.xml +++ b/src/main/gnome-shell/gnome-shell-theme.gresource.xml @@ -18,7 +18,6 @@ assets/activities.svg assets/view-app-grid.svg assets/background.png - assets/background-blur.png icons/scalable/actions/color-pick.svg icons/scalable/status/eye-not-looking-symbolic.svg icons/scalable/status/eye-open-negative-filled-symbolic.svg diff --git a/src/sass/gnome-shell/widgets-40-0/_overview.scss b/src/sass/gnome-shell/widgets-40-0/_overview.scss index 19a3e9b..6d20457 100644 --- a/src/sass/gnome-shell/widgets-40-0/_overview.scss +++ b/src/sass/gnome-shell/widgets-40-0/_overview.scss @@ -4,7 +4,7 @@ #overviewGroup { background-color: rgba($osd_bg_color, 1); - background-image: url("assets/background-blur.png"); + background-image: url("assets/background.png"); background-repeat: no-repeat; background-size: cover; } diff --git a/tweaks.sh b/tweaks.sh index 4ccc89a..5ceff99 100755 --- a/tweaks.sh +++ b/tweaks.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#! /usr/bin/env bash # WARNING: Please make this shell not working-directory dependant, for example # instead of using 'cd blabla', use 'cd "${REPO_DIR}/blabla"'