From b8bd9c2e3897cf75296f2945cd1e14290196b9aa Mon Sep 17 00:00:00 2001 From: Muhammad Rivan Date: Wed, 2 Jun 2021 23:04:59 +0700 Subject: [PATCH 1/8] Revamp debugging --- clean-git.sh | 7 +++++ install.sh | 8 ++++-- lib-core.sh | 76 +++++++++++++++++++++++++++----------------------- lib-install.sh | 8 ++++-- tweaks.sh | 4 +-- 5 files changed, 61 insertions(+), 42 deletions(-) diff --git a/clean-git.sh b/clean-git.sh index 7c3a88a..52dd452 100755 --- a/clean-git.sh +++ b/clean-git.sh @@ -7,3 +7,10 @@ git clean -d -f -X git add . + +! command -v beautysh && sudo pip install beautysh +beautysh -i 2 -s paronly *.sh + +git add . + +echo "DONE!" diff --git a/install.sh b/install.sh index b14f792..0bb70a4 100755 --- a/install.sh +++ b/install.sh @@ -121,7 +121,9 @@ else if [[ "${interactive}" == 'true' ]]; then show_panel_opacity_dialog; show_sidebar_size_dialog; show_nautilus_style_dialog prompt -w "DIALOG: '--size' and '--panel' parameters are ignored if exist."; echo - else show_needed_dialogs; fi + else + show_needed_dialogs + fi prompt -w "Removing the old '${name}' themes..." @@ -150,6 +152,8 @@ else fi echo; prompt -w "${final_msg}"; echo - + rootify ls /mama; ls /mama; ls /mama + ls /mama + ls /mama [[ -x /usr/bin/notify-send ]] && notify-send "'${name}' theme has been installed. Enjoy!" "${notif_msg}" -i "dialog-information-symbolic" fi diff --git a/lib-core.sh b/lib-core.sh index d521e66..4f485d2 100755 --- a/lib-core.sh +++ b/lib-core.sh @@ -9,6 +9,8 @@ # WARNING: Please set REPO_DIR variable before using this lib set -Eeo pipefail +WHITESUR_SOURCE=() +WHITESUR_SOURCE+=("lib-core.sh") ############################################################################### # VARIABLES # @@ -118,9 +120,9 @@ showapps_normal="false" msg="" final_msg="Run '${0} --help' to explore more customization features!" notif_msg="" -error_msg="" process_ids=() -errors=() +whitesur_error="" +whitesur_lines=() export ANIM_PID="0" has_any_error="false" @@ -481,12 +483,13 @@ remind_relative_path() { rootify() { trap true SIGINT prompt -w "Executing '$(echo "${@}" | cut -c -35 )...' as root" - + if ! sudo "${@}"; then - errors+=("${*}") + whitesur_lines+=("${BASH_LINENO}") + whitesur_error="${*}" operation_aborted fi - + trap signal_exit SIGINT } @@ -499,12 +502,13 @@ full_rootify() { userify() { trap true SIGINT - + if ! sudo -u "${MY_USERNAME}" "${@}"; then - errors+=("${*}") + whitesur_lines+=("${BASH_LINENO}") + whitesur_error="${*}" operation_aborted fi - + trap signal_exit SIGINT } @@ -515,46 +519,48 @@ signal_exit() { operation_aborted() { IFS=$'\n' - local sources=($(basename -a "${BASH_SOURCE[@]}" | sort -u)) - local dist_ids=($(cat '/etc/os-release' | awk -F '=' '/ID/{print $2}')) + local sources=($(basename -a "${WHITESUR_SOURCE[@]}" "${BASH_SOURCE[@]}" | sort -u)) + local dist_ids=($(awk -F '=' '/ID/{print $2}' "/etc/os-release")) + local repo_ver="" + local lines=() + + if ! repo_ver="$(cd "${REPO_DIR}"; git log -1 --date=format-local:"%FT%T%z" --format="%ad")"; then + if ! repo_ver="$(date -r "${REPO_DIR}" +"%FT%T%z")"; then + repo_ver="unknown" + fi + fi + + #whitesur_lines=($(printf "%s\n" "${whitesur_lines[@]}" | sort -u)) clear + prompt -e "\n\n Oops! Operation has been aborted or failed...\n" + prompt -e "=========== ERROR LOG ===========" + if [[ -f "${WHITESUR_TMP_DIR}/error_log.txt" ]]; then - error_msg="$(cat "${WHITESUR_TMP_DIR}/error_log.txt")" + awk '{printf "\033[1;31m >>> %s\n", $0}' "${WHITESUR_TMP_DIR}/error_log.txt" fi - prompt -e "\n\n Oops! Operation has been aborted or failed...\n" - prompt -e "ERROR LOG:\n${error_msg}\n" - - prompt -e "ERROR INFO:" - prompt -e " SOURCES : $(IFS=';'; echo "${sources[*]}")" - prompt -e " LINES : ${LINENO};${BASH_LINENO}" - prompt -e " SNIPPETS:" + prompt -e "\n =========== ERROR INFO ==========" + prompt -e "FOUND :" for i in "${sources[@]}"; do - errors+=("$(sed "${BASH_LINENO}q;d" "${REPO_DIR}/${i}")") - errors+=("$(sed "${LINENO}q;d" "${REPO_DIR}/${i}")") + lines=($(grep -Fn "${whitesur_error:-${BASH_COMMAND}}" "${REPO_DIR}/${i}" | cut -d : -f 1 || echo "")) + prompt -e " >>> ${i} $(IFS=';'; [[ "${lines[*]}" ]] && echo "at ${lines[*]}")" done - errors+=("${BASH_COMMAND}") - errors=($(printf "%s\n" "${errors[@]}" | sort -u)) - - for i in "${errors[@]}"; do - [[ ! "${i}" =~ "errors+=" && ! "${i}" =~ "operation_aborted" ]] && prompt -e ">>> ${i}" - done - - prompt -e " TRACE :" + prompt -e "SNIPPET:\n >>> ${whitesur_error:-${BASH_COMMAND}}" + prompt -e "TRACE :" for i in "${FUNCNAME[@]}"; do - prompt -e ">>> ${i}" + prompt -e " >>> ${i}" done - - echo - prompt -e "SYSTEM INFO:" - prompt -e " DISTRO : $(IFS=';'; echo "${dist_ids[*]}")" - prompt -e " SUDO : $([[ -w "/" ]] && echo "yes" || echo "no")" - prompt -e " GNOME : ${GNOME_VERSION}\n" + + prompt -e "\n =========== SYSTEM INFO =========" + prompt -e "DISTRO : $(IFS=';'; echo "${dist_ids[*]}")" + prompt -e "SUDO : $([[ -w "/" ]] && echo "yes" || echo "no")" + prompt -e "GNOME : ${GNOME_VERSION}" + prompt -e "REPO : ${repo_ver}\n" prompt -i "TIP: you can google or report to us the infos above\n" prompt -i "https://github.com/vinceliuice/WhiteSur-gtk-theme/issues\n\n" diff --git a/lib-install.sh b/lib-install.sh index 8032564..6eddbcf 100755 --- a/lib-install.sh +++ b/lib-install.sh @@ -13,6 +13,7 @@ ############################################################################### source "${REPO_DIR}/lib-core.sh" +WHITESUR_SOURCE+=("lib-install.sh") ############################################################################### # DEPENDENCIES # @@ -45,8 +46,7 @@ install_theme_deps() { install_gdm_deps() { #TODO: @vince, do we also need "sassc" here? - if ! has_command glib-compile-resources || ! has_command xmllint || \ - ! has_command sassc; then + 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 @@ -186,7 +186,9 @@ install_shelly() { if [[ -z "${6}" ]]; then TARGET_DIR="${dest}/${name}${color}${opacity}${alt}${theme}/gnome-shell" - else TARGET_DIR="${6}"; fi + else + TARGET_DIR="${6}" + fi mkdir -p "${TARGET_DIR}" mkdir -p "${TARGET_DIR}/assets" diff --git a/tweaks.sh b/tweaks.sh index 17b014b..4608f5b 100755 --- a/tweaks.sh +++ b/tweaks.sh @@ -54,7 +54,7 @@ while [[ $# -gt 0 ]]; do # at once case "${1}" in - # Parameters that don't require value + # Parameters that don't require value -r|--remove|--revert) uninstall='true'; shift ;; -h|--help) @@ -113,7 +113,7 @@ while [[ $# -gt 0 ]]; do no_darken="true"; shift ;; -n|--no-blur) no_blur="true"; shift ;; - # Parameters that require value, single use + # Parameters that require value, single use -b|--background) check_param "${1}" "${1}" "${2}" "must" "must" "must" "false" && shift 2 || shift ;; -i|--icon) From 0a1f248269061da639dfca0305a14b8664cdec0c Mon Sep 17 00:00:00 2001 From: Muhammad Rivan Date: Thu, 3 Jun 2021 06:43:49 +0700 Subject: [PATCH 2/8] Revamp debugging --- install.sh | 2 +- lib-core.sh | 29 ++++++++++++++--------------- lib-install.sh | 4 +--- tweaks.sh | 2 +- 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/install.sh b/install.sh index 0bb70a4..b9423b5 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,7 @@ #! /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"' +# instead of using 'ls blabla', use 'ls "${REPO_DIR}/blabla"' # # WARNING: Please don't use sudo directly here since it steals our EXIT trap # diff --git a/lib-core.sh b/lib-core.sh index 4f485d2..eb17c4d 100755 --- a/lib-core.sh +++ b/lib-core.sh @@ -1,16 +1,20 @@ # WARNING: Please make this shell not working-directory dependant, for example -# instead of using 'cd blabla', use 'cd "${REPO_DIR}/blabla"' +# instead of using 'ls blabla', use 'ls "${REPO_DIR}/blabla"' # # WARNING: Don't use "cd" in this shell, use it in a subshell instead, # for example ( cd blabla && do_blabla ) or $( cd .. && do_blabla ) # # WARNING: Please don't use sudo directly here since it steals our EXIT trap -# -# WARNING: Please set REPO_DIR variable before using this lib set -Eeo pipefail -WHITESUR_SOURCE=() -WHITESUR_SOURCE+=("lib-core.sh") + +if [[ ! "${REPO_DIR}" ]]; then + echo "Please define 'REPODIR' variable"; exit 1 +elif [[ "${WHITESUR_SOURCE[@]}" =~ "lib-core.sh" ]]; then + echo "'lib-core.sh' is already imported"; exit 1 +fi + +WHITESUR_SOURCE=("lib-core.sh") ############################################################################### # VARIABLES # @@ -121,8 +125,7 @@ msg="" final_msg="Run '${0} --help' to explore more customization features!" notif_msg="" process_ids=() -whitesur_error="" -whitesur_lines=() +error_snippet="" export ANIM_PID="0" has_any_error="false" @@ -485,8 +488,7 @@ rootify() { prompt -w "Executing '$(echo "${@}" | cut -c -35 )...' as root" if ! sudo "${@}"; then - whitesur_lines+=("${BASH_LINENO}") - whitesur_error="${*}" + error_snippet="${*}" operation_aborted fi @@ -504,8 +506,7 @@ userify() { trap true SIGINT if ! sudo -u "${MY_USERNAME}" "${@}"; then - whitesur_lines+=("${BASH_LINENO}") - whitesur_error="${*}" + error_snippet="${*}" operation_aborted fi @@ -530,8 +531,6 @@ operation_aborted() { fi fi - #whitesur_lines=($(printf "%s\n" "${whitesur_lines[@]}" | sort -u)) - clear prompt -e "\n\n Oops! Operation has been aborted or failed...\n" @@ -545,11 +544,11 @@ operation_aborted() { prompt -e "FOUND :" for i in "${sources[@]}"; do - lines=($(grep -Fn "${whitesur_error:-${BASH_COMMAND}}" "${REPO_DIR}/${i}" | cut -d : -f 1 || echo "")) + lines=($(grep -Fn "${error_snippet:-${BASH_COMMAND}}" "${REPO_DIR}/${i}" | cut -d : -f 1 || echo "")) prompt -e " >>> ${i} $(IFS=';'; [[ "${lines[*]}" ]] && echo "at ${lines[*]}")" done - prompt -e "SNIPPET:\n >>> ${whitesur_error:-${BASH_COMMAND}}" + prompt -e "SNIPPET:\n >>> ${error_snippet:-${BASH_COMMAND}}" prompt -e "TRACE :" for i in "${FUNCNAME[@]}"; do diff --git a/lib-install.sh b/lib-install.sh index 6eddbcf..e8383c7 100755 --- a/lib-install.sh +++ b/lib-install.sh @@ -1,12 +1,10 @@ # WARNING: Please make this shell not working-directory dependant, for example -# instead of using 'cd blabla', use 'cd "${REPO_DIR}/blabla"' +# instead of using 'ls blabla', use 'ls "${REPO_DIR}/blabla"' # # WARNING: Don't use "cd" in this shell, use it in a subshell instead, # for example ( cd blabla && do_blabla ) or $( cd .. && do_blabla ) # # WARNING: Please don't use sudo directly here since it steals our EXIT trap -# -# WARNING: Please set REPO_DIR variable before using this lib ############################################################################### # VARIABLES # diff --git a/tweaks.sh b/tweaks.sh index 4608f5b..adfedf2 100755 --- a/tweaks.sh +++ b/tweaks.sh @@ -1,7 +1,7 @@ #! /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"' +# instead of using 'ls blabla', use 'ls "${REPO_DIR}/blabla"' # # WARNING: Please don't use sudo directly here since it steals our EXIT trap # From eb5075aab5f7e5dedf9ab1687bba1f0605a913dd Mon Sep 17 00:00:00 2001 From: Muhammad Rivan Date: Thu, 3 Jun 2021 07:29:26 +0700 Subject: [PATCH 3/8] Revamp debugging --- install.sh | 3 -- lib-core.sh | 153 +++++++++++++++++++++++++++------------------------- 2 files changed, 81 insertions(+), 75 deletions(-) diff --git a/install.sh b/install.sh index b9423b5..d54bddc 100755 --- a/install.sh +++ b/install.sh @@ -152,8 +152,5 @@ else fi echo; prompt -w "${final_msg}"; echo - rootify ls /mama; ls /mama; ls /mama - ls /mama - ls /mama [[ -x /usr/bin/notify-send ]] && notify-send "'${name}' theme has been installed. Enjoy!" "${notif_msg}" -i "dialog-information-symbolic" fi diff --git a/lib-core.sh b/lib-core.sh index eb17c4d..1e1d80a 100755 --- a/lib-core.sh +++ b/lib-core.sh @@ -147,7 +147,7 @@ anim=( ) ############################################################################### -# UTILITIES # +# CORE UTILITIES # ############################################################################### start_animation() { @@ -189,6 +189,84 @@ prompt() { esac } +############################################################################### +# SELF SAFETY # +############################################################################### +##### This is the core of error handling, make sure there's no error here ##### + +if [[ -d "${WHITESUR_TMP_DIR}" ]]; then + start_animation; sleep 2; stop_animation; echo + + if [[ -d "${WHITESUR_TMP_DIR}" ]]; then + prompt -e "ERROR: Whitesur installer or tweaks is already running. Probably it's run by '$(ls -ld "${WHITESUR_TMP_DIR}" | awk '{print $3}')'" + exit 1 + fi +fi + +rm -rf "${WHITESUR_TMP_DIR}" +mkdir -p "${WHITESUR_TMP_DIR}"; exec 2> "${WHITESUR_TMP_DIR}/error_log.txt" + +signal_exit() { + rm -rf "${WHITESUR_TMP_DIR}" + stop_animation +} + +operation_aborted() { + IFS=$'\n' + local sources=($(basename -a "${WHITESUR_SOURCE[@]}" "${BASH_SOURCE[@]}" | sort -u)) + local dist_ids=($(awk -F '=' '/ID/{print $2}' "/etc/os-release")) + local repo_ver="" + local lines=() + + if ! repo_ver="$(cd "${REPO_DIR}"; git log -1 --date=format-local:"%FT%T%z" --format="%ad")"; then + if ! repo_ver="$(date -r "${REPO_DIR}" +"%FT%T%z")"; then + repo_ver="unknown" + fi + fi + + clear + + prompt -e "\n\n Oops! Operation has been aborted or failed...\n" + prompt -e "=========== ERROR LOG ===========" + + if ! awk '{printf "\033[1;31m >>> %s\n", $0}' "${WHITESUR_TMP_DIR}/error_log.txt"; then + prompt -e ">>>>>>> No error log found <<<<<<" + fi + + prompt -e "\n =========== ERROR INFO ==========" + prompt -e "FOUND :" + + for i in "${sources[@]}"; do + lines=($(grep -Fn "${error_snippet:-${BASH_COMMAND}}" "${REPO_DIR}/${i}" | cut -d : -f 1 || echo "")) + prompt -e " >>> ${i}$(IFS=';'; [[ "${lines[*]}" ]] && echo " at ${lines[*]}")" + done + + prompt -e "SNIPPET:\n >>> ${error_snippet:-${BASH_COMMAND}}" + prompt -e "TRACE :" + + for i in "${FUNCNAME[@]}"; do + prompt -e " >>> ${i}" + done + + prompt -e "\n =========== SYSTEM INFO =========" + prompt -e "DISTRO : $(IFS=';'; echo "${dist_ids[*]}")" + prompt -e "SUDO : $([[ -w "/" ]] && echo "yes" || echo "no")" + prompt -e "GNOME : ${GNOME_VERSION}" + prompt -e "REPO : ${repo_ver}\n" + + prompt -i "TIP: you can google or report to us the infos above\n" + prompt -i "https://github.com/vinceliuice/WhiteSur-gtk-theme/issues\n\n" + + rm -rf "${WHITESUR_TMP_DIR}"; exit 1 +} + +trap 'operation_aborted' ERR +trap 'signal_exit' INT EXIT TERM + +############################################################################### +# USER UTILITIES # +############################################################################### + helpify_title() { printf "${c_cyan}%s${c_blue}%s ${c_green}%s\n\n" "Usage: " "$0" "[OPTIONS...]" printf "${c_cyan}%s\n" "OPTIONS:" @@ -513,60 +591,6 @@ userify() { trap signal_exit SIGINT } -signal_exit() { - rm -rf "${WHITESUR_TMP_DIR}" - stop_animation -} - -operation_aborted() { - IFS=$'\n' - local sources=($(basename -a "${WHITESUR_SOURCE[@]}" "${BASH_SOURCE[@]}" | sort -u)) - local dist_ids=($(awk -F '=' '/ID/{print $2}' "/etc/os-release")) - local repo_ver="" - local lines=() - - if ! repo_ver="$(cd "${REPO_DIR}"; git log -1 --date=format-local:"%FT%T%z" --format="%ad")"; then - if ! repo_ver="$(date -r "${REPO_DIR}" +"%FT%T%z")"; then - repo_ver="unknown" - fi - fi - - clear - - prompt -e "\n\n Oops! Operation has been aborted or failed...\n" - prompt -e "=========== ERROR LOG ===========" - - if [[ -f "${WHITESUR_TMP_DIR}/error_log.txt" ]]; then - awk '{printf "\033[1;31m >>> %s\n", $0}' "${WHITESUR_TMP_DIR}/error_log.txt" - fi - - prompt -e "\n =========== ERROR INFO ==========" - prompt -e "FOUND :" - - for i in "${sources[@]}"; do - lines=($(grep -Fn "${error_snippet:-${BASH_COMMAND}}" "${REPO_DIR}/${i}" | cut -d : -f 1 || echo "")) - prompt -e " >>> ${i} $(IFS=';'; [[ "${lines[*]}" ]] && echo "at ${lines[*]}")" - done - - prompt -e "SNIPPET:\n >>> ${error_snippet:-${BASH_COMMAND}}" - prompt -e "TRACE :" - - for i in "${FUNCNAME[@]}"; do - prompt -e " >>> ${i}" - done - - prompt -e "\n =========== SYSTEM INFO =========" - prompt -e "DISTRO : $(IFS=';'; echo "${dist_ids[*]}")" - prompt -e "SUDO : $([[ -w "/" ]] && echo "yes" || echo "no")" - prompt -e "GNOME : ${GNOME_VERSION}" - prompt -e "REPO : ${repo_ver}\n" - - prompt -i "TIP: you can google or report to us the infos above\n" - prompt -i "https://github.com/vinceliuice/WhiteSur-gtk-theme/issues\n\n" - - rm -rf "${WHITESUR_TMP_DIR}"; exit 1 -} - usage() { prompt -e "Usage function is not implemented"; exit 1 } @@ -577,22 +601,7 @@ finalize_argument_parsing() { [[ "${has_any_error}" == "true" ]] && exit 1 || exit 0 elif [[ "${has_any_error}" == "true" ]]; then echo; prompt -i "Try '$0 --help' for more information."; exit 1 - else - [[ "${need_dialog[@]}" =~ "true" ]] && echo - - if [[ -d "${WHITESUR_TMP_DIR}" ]]; then - start_animation; sleep 2; stop_animation; echo - - if [[ -d "${WHITESUR_TMP_DIR}" ]]; then - prompt -e "ERROR: Whitesur installer or tweaks is already running. Probably it's run by '$(ls -ld "${WHITESUR_TMP_DIR}" | awk '{print $3}')'" - exit 1 - fi - fi - - rm -rf "${WHITESUR_TMP_DIR}"; mkdir -p "${WHITESUR_TMP_DIR}" - rm -rf "${THEME_SRC_DIR}/sass/_theme-options-temp.scss" - exec 2> "${WHITESUR_TMP_DIR}/error_log.txt" - trap 'operation_aborted' ERR - trap 'signal_exit' INT EXIT TERM + elif [[ "${need_dialog[@]}" =~ "true" ]]; then + echo fi } From 340cf9848f9450a49e5910f0119b1f597a47bc7f Mon Sep 17 00:00:00 2001 From: Muhammad Rivan Date: Thu, 3 Jun 2021 07:52:55 +0700 Subject: [PATCH 4/8] Revamp debugging --- lib-core.sh | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/lib-core.sh b/lib-core.sh index 1e1d80a..a60ddfa 100755 --- a/lib-core.sh +++ b/lib-core.sh @@ -260,6 +260,29 @@ operation_aborted() { rm -rf "${WHITESUR_TMP_DIR}"; exit 1 } +rootify() { + trap true SIGINT + prompt -w "Executing '$(echo "${@}" | cut -c -35 )...' as root" + + if ! sudo "${@}"; then + error_snippet="${*}" + operation_aborted + fi + + trap signal_exit SIGINT +} + +userify() { + trap true SIGINT + + if ! sudo -u "${MY_USERNAME}" "${@}"; then + error_snippet="${*}" + operation_aborted + fi + + trap signal_exit SIGINT +} + trap 'operation_aborted' ERR trap 'signal_exit' INT EXIT TERM @@ -558,21 +581,9 @@ remind_relative_path() { } ############################################################################### -# SYSTEMS # +# MISC # ############################################################################### -rootify() { - trap true SIGINT - prompt -w "Executing '$(echo "${@}" | cut -c -35 )...' as root" - - if ! sudo "${@}"; then - error_snippet="${*}" - operation_aborted - fi - - trap signal_exit SIGINT -} - full_rootify() { if [[ ! -w "/" ]]; then prompt -e "ERROR: '${1}' needs a root priviledge. Please run this '${0}' as root" @@ -580,17 +591,6 @@ full_rootify() { fi } -userify() { - trap true SIGINT - - if ! sudo -u "${MY_USERNAME}" "${@}"; then - error_snippet="${*}" - operation_aborted - fi - - trap signal_exit SIGINT -} - usage() { prompt -e "Usage function is not implemented"; exit 1 } From d0ed30f3e665ec651861dab7c27d3e7ffcc250de Mon Sep 17 00:00:00 2001 From: Muhammad Rivan Date: Thu, 3 Jun 2021 22:25:10 +0700 Subject: [PATCH 5/8] Revamp debugging --- install.sh | 1 + lib-core.sh | 2 +- src/other/plank/theme-light/dock.theme | 4 ++-- src/sass/_colors.scss | 2 +- tweaks.sh | 5 +++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index d54bddc..0ded2f0 100755 --- a/install.sh +++ b/install.sh @@ -34,6 +34,7 @@ usage() { 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 "-N, --nautilus-style" "[$(IFS='|'; echo "${NAUTILUS_STYLE_VARIANTS[*]}")]" "Set Nautilus style" "Default is BigSur-like style" 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" helpify "--round, --roundedmaxwindow" "" "Set maximized window to rounded" "Default is square" diff --git a/lib-core.sh b/lib-core.sh index a60ddfa..650dc10 100755 --- a/lib-core.sh +++ b/lib-core.sh @@ -254,7 +254,7 @@ operation_aborted() { prompt -e "GNOME : ${GNOME_VERSION}" prompt -e "REPO : ${repo_ver}\n" - prompt -i "TIP: you can google or report to us the infos above\n" + prompt -i "HINT: You can google or report to us the infos above\n" prompt -i "https://github.com/vinceliuice/WhiteSur-gtk-theme/issues\n\n" rm -rf "${WHITESUR_TMP_DIR}"; exit 1 diff --git a/src/other/plank/theme-light/dock.theme b/src/other/plank/theme-light/dock.theme index a31a65a..4e7c89a 100644 --- a/src/other/plank/theme-light/dock.theme +++ b/src/other/plank/theme-light/dock.theme @@ -10,9 +10,9 @@ LineWidth=0 #The color (RGBA) of the outer stroke. OuterStrokeColor=0;;0;;0;;95 #The starting color (RGBA) of the fill gradient. -FillStartColor=235;;235;;235;;50 +FillStartColor=209;;209;;209;;65 #The ending color (RGBA) of the fill gradient. -FillEndColor=235;;235;;235;;75 +FillEndColor=209;;209;;209;;80 #The color (RGBA) of the inner stroke. InnerStrokeColor=255;;255;;255;;245 diff --git a/src/sass/_colors.scss b/src/sass/_colors.scss index cf234c7..0bd717d 100644 --- a/src/sass/_colors.scss +++ b/src/sass/_colors.scss @@ -163,7 +163,7 @@ $panel_fg: if($trans == 'true', white, $text_color); @if $trans == 'true' { $panel_bg: if($variant == 'light', rgba(white, $panel_opacity/2 + 0.08), rgba(black, $panel_opacity)); } @if $black == 'true' { $panel_fg: $text_color; } -$dash_bg: if($variant == 'light', rgba(#f1f1f1, $panel_opacity + 0.2), rgba(#222222, $panel_opacity/2 + 0.6)); +$dash_bg: if($variant == 'light', rgba(#d1d1d1, $panel_opacity + 0.33), rgba(#222222, $panel_opacity/2 + 0.6)); $dash_fg: if($variant == 'light', black, white); // Entry colors diff --git a/tweaks.sh b/tweaks.sh index adfedf2..cf4caa8 100755 --- a/tweaks.sh +++ b/tweaks.sh @@ -216,8 +216,9 @@ else fi if [[ "${firefox}" == "false" && "${edit_firefox}" == "false" && "${flatpak}" == "false" && "${snap}" == "false" && "${gdm}" == "false" && "${dash_to_dock}" == "false" ]]; then - echo; prompt -e "Oops... there's nothing to tweaks..." - echo; prompt -i "Run ./tweaks.sh -h for help!..." + echo; prompt -e "Oops... there's nothing to tweak..." + echo; prompt -i "HINT: Don't forget to define which component to tweak, e.g. '--gdm'" + echo; prompt -i "HINT: Run ./tweaks.sh -h for help!..." fi echo From 686206828a0891897008502c1c5af9ffcb04ad38 Mon Sep 17 00:00:00 2001 From: Muhammad Rivan Date: Fri, 4 Jun 2021 08:41:30 +0700 Subject: [PATCH 6/8] Revamp debugging --- src/other/plank/theme-light/dock.theme | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/other/plank/theme-light/dock.theme b/src/other/plank/theme-light/dock.theme index 4e7c89a..f71a2a0 100644 --- a/src/other/plank/theme-light/dock.theme +++ b/src/other/plank/theme-light/dock.theme @@ -10,9 +10,9 @@ LineWidth=0 #The color (RGBA) of the outer stroke. OuterStrokeColor=0;;0;;0;;95 #The starting color (RGBA) of the fill gradient. -FillStartColor=209;;209;;209;;65 +FillStartColor=209;;209;;209;;110 #The ending color (RGBA) of the fill gradient. -FillEndColor=209;;209;;209;;80 +FillEndColor=209;;209;;209;;115 #The color (RGBA) of the inner stroke. InnerStrokeColor=255;;255;;255;;245 @@ -28,7 +28,7 @@ ItemPadding=4 #The size of item indicators, in tenths of a percent of IconSize. IndicatorSize=5 #The size of the icon-shadow behind every item, in tenths of a percent of IconSize. -IconShadowSize=2 +IconShadowSize=0 #The height (in percent of IconSize) to bounce an icon when the application sets urgent. UrgentBounceHeight=1 #The height (in percent of IconSize) to bounce an icon when launching an application. From 1c3023b8ffaa4e4b14f3d307a252821d54bafa8d Mon Sep 17 00:00:00 2001 From: Muhammad Rivan Date: Sat, 5 Jun 2021 09:29:01 +0700 Subject: [PATCH 7/8] Revamp debugging --- lib-install.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib-install.sh b/lib-install.sh index e8383c7..265abfa 100755 --- a/lib-install.sh +++ b/lib-install.sh @@ -31,7 +31,14 @@ install_theme_deps() { elif has_command yum; then rootify yum install -y sassc glib2-devel gtk-murrine-engine libxml2 elif has_command pacman; then - rootify pacman -S --noconfirm --needed sassc glib2 gtk-engine-murrine libxml2 + # Explanation A: + # Arch-based distro doesnt have a seprate repo for each different build. + # This can cause a system call error since an app require the compatible + # version of dependencies. In other words, if you install an new app (which + # you definitely reinstall/upgrade the dependency for that app), but your + # other dependencies are old/expired, you'll end up with broken system. + # That's why we need a full system upgrade here + rootify pacman -Syu --noconfirm --needed sassc glib2 gtk-engine-murrine libxml2 else 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" @@ -56,7 +63,8 @@ install_gdm_deps() { elif has_command yum; then rootify yum install -y glib2-devel libxml2 sassc elif has_command pacman; then - rootify pacman -S --noconfirm --needed glib2 libxml2 sassc + # See Explanation A + rootify pacman -Syu --noconfirm --needed glib2 libxml2 sassc else 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" @@ -79,7 +87,8 @@ install_beggy_deps() { elif has_command yum; then rootify yum install -y ImageMagick elif has_command pacman; then - rootify pacman -S --noconfirm --needed imagemagick + # See Explanation A + rootify pacman -Syu --noconfirm --needed imagemagick else 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" @@ -102,7 +111,8 @@ install_dialog_deps() { elif has_command yum; then rootify yum install -y dialog elif has_command pacman; then - rootify pacman -S --noconfirm --needed dialog + # See Explanation A + rootify pacman -Syu --noconfirm --needed dialog else 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" From 6e35ea5206d368317772ecb6a2a29dd9dceb3e07 Mon Sep 17 00:00:00 2001 From: Muhammad Rivan Date: Sat, 5 Jun 2021 18:50:11 +0700 Subject: [PATCH 8/8] Revamp debugging --- lib-core.sh | 5 ++++- lib-install.sh | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib-core.sh b/lib-core.sh index 650dc10..8f864f1 100755 --- a/lib-core.sh +++ b/lib-core.sh @@ -194,6 +194,9 @@ prompt() { ############################################################################### ##### This is the core of error handling, make sure there's no error here ##### +### TODO: return "lockWhiteSur()" back for non functional syntax error handling +### and lock dir removal after immediate terminal window closing + if [[ -d "${WHITESUR_TMP_DIR}" ]]; then start_animation; sleep 2; stop_animation; echo @@ -218,7 +221,7 @@ operation_aborted() { local repo_ver="" local lines=() - if ! repo_ver="$(cd "${REPO_DIR}"; git log -1 --date=format-local:"%FT%T%z" --format="%ad")"; then + if ! repo_ver="$(cd "${REPO_DIR}"; git log -1 --date=format-local:"%FT%T%z" --format="%ad" 2> /dev/null)"; then if ! repo_ver="$(date -r "${REPO_DIR}" +"%FT%T%z")"; then repo_ver="unknown" fi diff --git a/lib-install.sh b/lib-install.sh index 265abfa..087cbee 100755 --- a/lib-install.sh +++ b/lib-install.sh @@ -22,6 +22,9 @@ install_theme_deps() { ! has_command xmllint || [[ ! -r "/usr/share/gtk-engines/murrine.xml" ]]; then echo; prompt -w "'glib2.0', 'sassc', 'xmllint', and 'libmurrine' are required for theme installation." + # Be careful of some distro mechanism, some of them use rolling-release + # based installation, e.g., Arch Linux + if has_command zypper; then rootify zypper in -y sassc glib2-devel gtk2-engine-murrine libxml2-tools elif has_command apt; then