1
0
Fork 0
mirror of https://github.com/vinceliuice/WhiteSur-icon-theme.git synced 2024-10-16 11:40:47 +00:00

FIX: #30 Non-apple alternative

This commit aims to resolve issue #30
It add 2 "alternative" icons, for softwarecenter and file-manager.
To use them, I added a parameter (-a or --alternative) in the install.sh. When specified,
it will call a function to change the name of the icons and use the
"alternative" one instead of the "apple" icons during installation.
At the end of the installation, it reset the icons to their default
value.
This commit is contained in:
alvatip 2021-06-16 18:41:27 +02:00
parent 75d690cefc
commit 0a7a41b996
4 changed files with 127 additions and 1 deletions

View file

@ -11,6 +11,7 @@ Usage: `./install.sh` **[OPTIONS...]**
|:--------------------|:-------------| |:--------------------|:-------------|
|-d, --dest | Specify theme destination directory (Default: $HOME/.themes)| |-d, --dest | Specify theme destination directory (Default: $HOME/.themes)|
|-n, --name | Specify theme name (Default: WhiteSur)| |-n, --name | Specify theme name (Default: WhiteSur)|
|-a, --alternative | Install alternative icons for software center and file-manager|
|-h, --help | Show this help| |-h, --help | Show this help|
> **Note for snaps:** To use these icons with snaps, the best way is to make a copy of the application's .desktop located in `/var/lib/snapd/desktop/applications/name-of-the-snap-application.desktop` into `$HOME/.local/share/applications/`. Then use any text editor and change the "Icon=" to "Icon=name-of-the-icon.svg" > **Note for snaps:** To use these icons with snaps, the best way is to make a copy of the application's .desktop located in `/var/lib/snapd/desktop/applications/name-of-the-snap-application.desktop` into `$HOME/.local/share/applications/`. Then use any text editor and change the "Icon=" to "Icon=name-of-the-icon.svg"

View file

@ -22,9 +22,31 @@ usage() {
printf " %-25s%s\n" "-d, --dest DIR" "Specify theme destination directory (Default: ${DEST_DIR})" printf " %-25s%s\n" "-d, --dest DIR" "Specify theme destination directory (Default: ${DEST_DIR})"
printf " %-25s%s\n" "-n, --name NAME" "Specify theme name (Default: ${THEME_NAME})" printf " %-25s%s\n" "-n, --name NAME" "Specify theme name (Default: ${THEME_NAME})"
printf " %-25s%s\n" "-t, --theme VARIANTS" "Specify folder color [default|purple|pink|red|orange|yellow|green|grey|all] (Default: MacOS blue)" printf " %-25s%s\n" "-t, --theme VARIANTS" "Specify folder color [default|purple|pink|red|orange|yellow|green|grey|all] (Default: MacOS blue)"
printf " %-25s%s\n" "-a, --alternative" "Install alternative icons for software center and file-manager"
printf " %-25s%s\n" "-h, --help" "Show this help" printf " %-25s%s\n" "-h, --help" "Show this help"
} }
# change the name of software and file-manager to use the alternative
alternative() {
local dir="${SRC_DIR}/src/apps/scalable"
if [[ ${1} == 'unset' ]]; then
# Software
mv ${dir}/softwarecenter.svg ${dir}/softwarecenter-alternative.svg
mv ${dir}/softwarecenter-old.svg ${dir}/softwarecenter.svg
# File-manager
mv ${dir}/file-manager.svg ${dir}/file-manager-alternative.svg
mv ${dir}/file-manager-old.svg ${dir}/file-manager.svg
else
# Software
mv ${dir}/softwarecenter.svg ${dir}/softwarecenter-old.svg
mv ${dir}/softwarecenter-alternative.svg ${dir}/softwarecenter.svg
# File-manager
mv ${dir}/file-manager.svg ${dir}/file-manager-old.svg
mv ${dir}/file-manager-alternative.svg ${dir}/file-manager.svg
fi
}
install() { install() {
local dest=${1} local dest=${1}
local name=${2} local name=${2}
@ -183,6 +205,10 @@ while [[ $# -gt 0 ]]; do
esac esac
done done
;; ;;
-a|--alternative)
alternative
alternative=true
;;
-h|--help) -h|--help)
usage usage
exit 0 exit 0
@ -197,11 +223,17 @@ while [[ $# -gt 0 ]]; do
done done
install_theme() { install_theme() {
for theme in "${themes[@]-${THEME_VARIANTS[0]}}"; do for theme in "${themes[@]-${THEME_VARIANTS[0]}}"; do
for color in "${colors[@]-${COLOR_VARIANTS[@]}}"; do for color in "${colors[@]-${COLOR_VARIANTS[@]}}"; do
install "${dest:-${DEST_DIR}}" "${name:-${THEME_NAME}}" "${theme}" "${color}" install "${dest:-${DEST_DIR}}" "${name:-${THEME_NAME}}" "${theme}" "${color}"
done done
done done
# restore the names in the source file
if [[ $alternative == true ]]; then
alternative 'unset'
fi
} }
install_theme install_theme

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.5 KiB