From ab44578b1fe268493f7a2967150b0813b08c8b79 Mon Sep 17 00:00:00 2001 From: Muhammad Rivan Date: Sun, 23 May 2021 20:04:01 +0700 Subject: [PATCH] refactor --- .gitignore | 3 +-- CONTRIBUTING.md | 4 +--- clean-git.sh | 2 ++ install.sh | 1 + lib-install.sh | 46 +++++++++++++++------------------------------- tweaks.sh | 2 +- 6 files changed, 21 insertions(+), 37 deletions(-) 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 9a6deb3..b14f792 100755 --- a/install.sh +++ b/install.sh @@ -32,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 fcdcec3..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,19 +47,22 @@ install_theme_deps() { } install_gdm_deps() { - if ! has_command glib-compile-resources || ! has_command xmllint; 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 "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" @@ -70,29 +73,8 @@ install_gdm_deps() { } 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 "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 - 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 @@ -357,6 +339,9 @@ remove_packy() { ############################################################################### install_themes() { + # "install_theemy" and "install_shelly" require "gtk_base", so multithreading + # isn't possible + start_animation; install_beggy for opacity in "${opacities[@]}"; do @@ -564,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 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"'