From ea95cfa5e263143825c34c3f6254404ca7d5298f Mon Sep 17 00:00:00 2001 From: vinceliuice Date: Tue, 15 Oct 2024 16:30:39 +0800 Subject: [PATCH] Fixed #1148 --- install.sh | 3 +-- shell/lib-core.sh | 4 +--- shell/lib-install.sh | 21 +++++++++++++-------- tweaks.sh | 4 ++-- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/install.sh b/install.sh index 38aae406..8ba90989 100755 --- a/install.sh +++ b/install.sh @@ -177,7 +177,7 @@ else remove_themes; customize_theme; avoid_variant_duplicates; - prompt -w "Installing '${name}' '${themes[*]}' '${schemes[*]}' themes in '${dest}'...\n"; + prompt -w "Installing '${name}' themes in '${dest}'...\n"; prompt -t "--->>> GTK | GNOME Shell | Cinnamon | Metacity | XFWM | Plank <<<---" prompt -i "Color variants : $( IFS=';'; echo "${colors[*]}" )" @@ -193,7 +193,6 @@ else if [[ "${libadwaita}" == 'true' ]]; then if [[ "$UID" != '0' ]]; then install_libadwaita - echo; prompt -s "Installed ${name} ${opacities} ${colors} gtk-4.0 theme in '${HOME}/.config/gtk-4.0' for libadwaita!" echo; prompt -w "Some colorsheme extension will re-writes config files in '${HOME}/.config/gtk-4.0' like: 'custom-accent-colors' you need disable it!" else echo; prompt -e "Do not run '--libadwaita' option with sudo!" diff --git a/shell/lib-core.sh b/shell/lib-core.sh index 9970045e..155cf84b 100755 --- a/shell/lib-core.sh +++ b/shell/lib-core.sh @@ -577,9 +577,7 @@ check_param() { done ;; -c) for i in {0..1}; do - if [[ "${value}" == "${COLOR_VARIANTS[i]}" ]]; then - colors+=("${COLOR_VARIANTS[i]}"); variant_found="true"; break - elif [[ "${value}" == "${COMMAND_COLOR_VARIANTS[i]}" ]]; then + if [[ "${value}" == "${COLOR_VARIANTS[i]}" || "${value}" == "${COMMAND_COLOR_VARIANTS[i]}" ]]; then colors+=("${COLOR_VARIANTS[i]}"); variant_found="true"; break fi done ;; diff --git a/shell/lib-install.sh b/shell/lib-install.sh index b0db7657..ff3fb7df 100755 --- a/shell/lib-install.sh +++ b/shell/lib-install.sh @@ -517,35 +517,40 @@ remove_old_packy() { config_gtk4() { local color="$(destify ${1})" - local alt="$(destify ${2})" - local scheme="$(destify ${3})" + local opacity="$(destify ${2})" + local alt="$(destify ${3})" + local theme="$(destify ${4})" + local scheme="$(destify ${5})" local TARGET_DIR="${HOME}/.config/gtk-4.0" # Install gtk4.0 into config for libadwaita + mkdir -p "${TARGET_DIR}" # backup_file "${TARGET_DIR}/gtk.css" "udo" - rm -rf "${TARGET_DIR}/"{gtk.css,gtk-Light.css,gtk-Dark.css,assets,windows-assets} + rm -rf "${TARGET_DIR}/"{gtk.css,gtk-dark.css,gtk-Light.css,gtk-Dark.css,assets,windows-assets} sassc ${SASSC_OPT} "${THEME_SRC_DIR}/main/gtk-4.0/gtk-Light.scss" "${TARGET_DIR}/gtk-Light.css" sassc ${SASSC_OPT} "${THEME_SRC_DIR}/main/gtk-4.0/gtk-Dark.scss" "${TARGET_DIR}/gtk-Dark.css" - ln -sf "${TARGET_DIR}/gtk-${color}.css" "${TARGET_DIR}/gtk.css" + ln -sf "${TARGET_DIR}/gtk${color}.css" "${TARGET_DIR}/gtk.css" + ln -sf "${TARGET_DIR}/gtk-Dark.css" "${TARGET_DIR}/gtk-dark.css" cp -r "${THEME_SRC_DIR}/assets/gtk/common-assets/assets" "${TARGET_DIR}" cp -r "${THEME_SRC_DIR}/assets/gtk/common-assets/sidebar-assets/"*".png" "${TARGET_DIR}/assets" cp -r "${THEME_SRC_DIR}/assets/gtk/scalable" "${TARGET_DIR}/assets" cp -r "${THEME_SRC_DIR}/assets/gtk/windows-assets/titlebutton${alt}${scheme}" "${TARGET_DIR}/windows-assets" + + prompt -s "\n Installed ${name}${color}${opacity}${alt}${theme}${scheme} gtk-4.0 theme in '${HOME}/.config/gtk-4.0' for libadwaita!" } install_libadwaita() { + color="${colors[0]}" opacity="${opacities[0]}" - color="${colors[1]}" - scheme="${schemes[0]}" - gtk_base && config_gtk4 "${color}" "${alt}" "${scheme}" + gtk_base && config_gtk4 "${color}" "${opacity}" "${alt}" "${theme}" "${scheme}" } remove_libadwaita() { # restore_file "${TARGET_DIR}/gtk.css" - rm -rf "${HOME}/.config/gtk-4.0/"{gtk.css,gtk-Light.css,gtk-Dark.css,assets,windows-assets} + rm -rf "${HOME}/.config/gtk-4.0/"{gtk.css,gtk-dark.css,gtk-Light.css,gtk-Dark.css,assets,windows-assets} } ############################################################################### diff --git a/tweaks.sh b/tweaks.sh index 01e1ecb3..bdba4494 100755 --- a/tweaks.sh +++ b/tweaks.sh @@ -197,7 +197,7 @@ while [[ $# -gt 0 ]]; do gdm="true"; full_sudo "${1}" showapps_normal="true" # use normal showapps icon background="default" - + shift for variant in "${@}"; do case "${variant}" in -i|-icon) @@ -225,7 +225,7 @@ while [[ $# -gt 0 ]]; do if ! has_command gdm && ! has_command gdm3 && [[ ! -e /usr/sbin/gdm3 ]]; then prompt -e "'${1}' ERROR: There's no GDM installed in your system" has_any_error="true" - fi; shift ;; + fi ;; -F|--flatpak) flatpak="true"; signal_exit