This commit is contained in:
vinceliuice 2020-12-07 14:44:28 +08:00
parent 9e2aeff147
commit b1d57ade04
2 changed files with 34 additions and 12 deletions

View file

@ -99,7 +99,7 @@ Usage: `./Install` **[OPTIONS...]**
|-s, --size | Run a dialg to change the nautilus sidebar width size (Default: 200px)|
|-i, --icon | activities icon variant(s) **[standard/normal/gnome/ubuntu/arch/manjaro/fedora/debian/void]** (Default: standard variant)|
|-g, --gdm | Install GDM theme, you should run this with sudo!|
|-r, --revert | revert GDM theme, you should run this with sudo!|
|-r, --remove | remove theme, this will remove all installed themes!|
|-h, --help | Show this help|
If you want to change the nautilus sidebar width size, then you can run:
@ -110,6 +110,14 @@ If you want to change the panel transparency, then you can run:
./install.sh -t
If you want to remove all installed themes, then you can run:
./install.sh -r
If you want to remove installed gdm theme, then you can run:
./install.sh -r -g
### Suggested themes
| Suggested themes | links | preview |
|:--------------------|:-------------|:-------------|

View file

@ -73,7 +73,7 @@ usage() {
printf " %-25s%s\n" "-s, --size VARIANTS" "Run a dialg to change the nautilus sidebar width size (Default: 200px)"
printf " %-25s%s\n" "-i, --icon VARIANTS" "Specify activities icon variant(s) for gnome-shell [standard|normal|gnome|ubuntu|arch|manjaro|fedora|debian|void] (Default: standard variant)"
printf " %-25s%s\n" "-g, --gdm" "Install GDM theme, this option need root user authority! please run this with sudo"
printf " %-25s%s\n" "-r, --revert" "revert GDM theme, this option need root user authority! please run this with sudo"
printf " %-25s%s\n" "-r, --remove" "remove theme, remove all installed themes"
printf " %-25s%s\n" "-h, --help" "Show this help"
}
@ -218,6 +218,16 @@ install_gdm() {
fi
}
remove_theme() {
for color in "${colors[@]-${COLOR_VARIANTS[@]}}"; do
for opacity in "${opacities[@]-${OPACITY_VARIANTS[@]}}"; do
for alt in "${alts[@]-${ALT_VARIANTS[@]}}"; do
[[ -d "${DEST_DIR}/${THEME_NAME}${color}${opacity}${alt}" ]] && rm -rf "${DEST_DIR}/${THEME_NAME}${color}${opacity}${alt}"
done
done
done
}
revert_gdm() {
if [[ -f "$GS_THEME_FILE.bak" ]]; then
prompt -w "reverting '$GS_THEME_FILE'..."
@ -371,8 +381,8 @@ while [[ $# -gt 0 ]]; do
trans='true'
shift 1
;;
-r|--revert)
revert='true'
-r|--remove)
remove='true'
shift 1
;;
-a|--alt)
@ -508,15 +518,15 @@ while [[ $# -gt 0 ]]; do
done
install_theme() {
for opacity in "${opacities[@]-${OPACITY_VARIANTS[@]}}"; do
for color in "${colors[@]-${COLOR_VARIANTS[@]}}"; do
for alt in "${alts[@]-${ALT_VARIANTS[@]}}"; do
for icon in "${icons[@]-${ICON_VARIANTS[0]}}"; do
install "${dest:-${DEST_DIR}}" "${name:-${THEME_NAME}}" "${color}" "${opacity}" "${alt}" "${icon}"
for opacity in "${opacities[@]-${OPACITY_VARIANTS[@]}}"; do
for alt in "${alts[@]-${ALT_VARIANTS[@]}}"; do
for icon in "${icons[@]-${ICON_VARIANTS[0]}}"; do
install "${dest:-${DEST_DIR}}" "${name:-${THEME_NAME}}" "${color}" "${opacity}" "${alt}" "${icon}"
done
done
done
done
done
}
if [[ "${size:-}" == 'true' ]]; then
@ -531,15 +541,19 @@ if [[ "${trans:-}" == 'true' ]]; then
install_dialog && run_shell_dialog && change_transparency && parse_sass
fi
if [[ "${gdm:-}" != 'true' && "${revert:-}" != 'true' ]]; then
if [[ "${gdm:-}" != 'true' && "${remove:-}" != 'true' ]]; then
install_theme
fi
if [[ "${gdm:-}" == 'true' && "${revert:-}" != 'true' && "$UID" -eq "$ROOT_UID" ]]; then
if [[ "${gdm:-}" == 'true' && "${remove:-}" != 'true' && "$UID" -eq "$ROOT_UID" ]]; then
install_theme && install_gdm "${dest:-${DEST_DIR}}" "${name:-${THEME_NAME}}" "${color}" "${opacity}"
fi
if [[ "${gdm:-}" != 'true' && "${revert:-}" == 'true' && "$UID" -eq "$ROOT_UID" ]]; then
if [[ "${gdm:-}" != 'true' && "${remove:-}" == 'true' ]]; then
remove_theme
fi
if [[ "${gdm:-}" == 'true' && "${remove:-}" == 'true' && "$UID" -eq "$ROOT_UID" ]]; then
revert_gdm
fi