mirror of
https://github.com/vinceliuice/WhiteSur-icon-theme.git
synced 2024-11-26 07:40:09 +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:
parent
75d690cefc
commit
0a7a41b996
4 changed files with 127 additions and 1 deletions
|
@ -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"
|
||||||
|
|
32
install.sh
32
install.sh
|
@ -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
|
53
src/apps/scalable/file-manager-alternative.svg
Normal file
53
src/apps/scalable/file-manager-alternative.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 12 KiB |
40
src/apps/scalable/softwarecenter-alternative.svg
Normal file
40
src/apps/scalable/softwarecenter-alternative.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 9.5 KiB |
Loading…
Reference in a new issue