From be0ceaf1301d56a6e8ce3e757ccac5d93b48d5c0 Mon Sep 17 00:00:00 2001 From: Vince Date: Sun, 4 Jul 2021 23:14:42 +0800 Subject: [PATCH] update --- src/other/firefox/README.md | 2 +- tweaks.sh | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/other/firefox/README.md b/src/other/firefox/README.md index 24c7152..cecdbe5 100644 --- a/src/other/firefox/README.md +++ b/src/other/firefox/README.md @@ -17,7 +17,7 @@ Run `./tweaks.sh -f` if you want to use `Monterey` style then: -Run `./tweaks.sh -f -m` +Run `./tweaks.sh -f monterey` ![01](https://github.com/vinceliuice/WhiteSur-gtk-theme/blob/pictures/pictures/firefox-monterey.png?raw=true) diff --git a/tweaks.sh b/tweaks.sh index 5adc621..e1c7b0f 100755 --- a/tweaks.sh +++ b/tweaks.sh @@ -19,8 +19,7 @@ usage() { # Please specify their default value manually, some of them are come from _variables.scss # You also have to check and update them regurally helpify_title - helpify "-f, --firefox" "" "Install '${THEME_NAME}' theme for Firefox and connect it to the current Firefox profiles" "" - helpify "-m, --monterey" "( Run this with -f )" "Install 'Monterey' theme for Firefox and connect it to the current Firefox profiles" "" + helpify "-f, --firefox" "[default|monterey]" "Install '${THEME_NAME}|Monterey' theme for Firefox and connect it to the current Firefox profiles" "Default is ${THEME_NAME}" helpify "-e, --edit-firefox" "" "Edit '${THEME_NAME}' theme for Firefox settings and also connect the theme to the current Firefox profiles" "" helpify "-F, --flatpak" "" "Connect '${THEME_NAME}' theme to Flatpak" "" helpify "-s, --snap" "" "Connect '${THEME_NAME}' theme the currently installed snap apps" "" @@ -65,17 +64,27 @@ while [[ $# -gt 0 ]]; do full_sudo "${1}"; silent_mode='true'; shift ;; -h|--help) need_help="true"; shift ;; - -f|--firefox|-e|--edit-firefox|-m|--monterey) + -f|--firefox|-e|--edit-firefox) case "${1}" in -f|--firefox) firefox="true" ;; -e|--edit-firefox) edit_firefox="true" ;; - -m|--monterey) - monterey="true" - name="Monterey" ;; esac + for variant in "${@}"; do + case "${variant}" in + default) + shift 1 + ;; + monterey) + monterey="true" + name="Monterey" + shift 1 + ;; + esac + done + if ! has_command firefox && ! has_flatpak_app org.mozilla.firefox && ! has_snap_app firefox; then prompt -e "'${1}' ERROR: There's no Firefox installed in your system" has_any_error="true"