Skip to content

Commit

Permalink
Fixed issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceliuice committed Sep 1, 2022
1 parent 859d4ba commit e5e3e44
Show file tree
Hide file tree
Showing 14 changed files with 445 additions and 40,404 deletions.
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
*-temp.scss

src/main/cinnamon/cinnamon-dark.css
src/main/cinnamon/cinnamon-light.css
src/main/cinnamon/cinnamon-Dark.css
src/main/cinnamon/cinnamon-Light.css
src/main/cinnamon/cinnamon.css
src/main/gtk-3.0/gtk-dark.css
src/main/gtk-3.0/gtk-light.css
src/main/gtk-3.0/gtk-Dark.css
src/main/gtk-3.0/gtk-Light.css
src/main/gtk-3.0/gtk.css
src/main/gtk-4.0/gtk-dark.css
src/main/gtk-4.0/gtk-light.css
src/main/gtk-4.0/gtk-Dark.css
src/main/gtk-4.0/gtk-Light.css
src/main/gtk-4.0/gtk.css
src/main/gnome-shell/gnome-shell-dark.css
src/main/gnome-shell/gnome-shell-light.css
src/main/gnome-shell/gnome-shell-Dark.css
src/main/gnome-shell/gnome-shell-Light.css
src/main/gnome-shell/gnome-shell.css
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Run the following commands in the terminal:
-t, --theme VARIANT... Specify theme color variant(s) [default|purple|pink|red|orange|yellow|green|teal|blue|all] (Default: grey)
-c, --color VARIANT... Specify color variant(s) [standard|light|dark] (Default: All variants)
-s, --size VARIANT... Specify size variant [standard|compact] (Default: standard variant)
-l, --libadwaita Install link to gtk4 config for theming libadwaita
-u, --uninstall Uninstall themes or link for libadwaita
--tweaks Specify versions for tweaks [nord|black|darker|rimless|normal]
(WORRING: 'nord' and 'darker' can not mix use with 'black'!)
1. nord: Nord colorscheme version
Expand Down
93 changes: 92 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ OPTIONS:
-s, --size VARIANT Specify size variant [standard|compact] (Default: standard variants)
-l, --libadwaita Install link to gtk4 config for theming libadwaita
-u, --uninstall Uninstall themes or link for libadwaita
--tweaks Specify versions for tweaks [nord|black|darker|rimless|normal]
(WORRING: 'nord' and 'darker' can not mix use with 'black'!)
1. nord: Nord colorscheme version
Expand Down Expand Up @@ -187,6 +191,7 @@ clean() {
themes=()
colors=()
sizes=()
lcolors=()

while [[ $# -gt 0 ]]; do
case "${1}" in
Expand All @@ -202,20 +207,31 @@ while [[ $# -gt 0 ]]; do
name="${2}"
shift 2
;;
-l|--libadwaita)
libadwaita="true"
shift
;;
-u|--uninstall)
uninstall="true"
shift
;;
-c|--color)
shift
for color in "${@}"; do
case "${color}" in
standard)
colors+=("${COLOR_VARIANTS[0]}")
lcolors+=("${COLOR_VARIANTS[0]}")
shift
;;
light)
colors+=("${COLOR_VARIANTS[1]}")
lcolors+=("${COLOR_VARIANTS[1]}")
shift
;;
dark)
colors+=("${COLOR_VARIANTS[2]}")
lcolors+=("${COLOR_VARIANTS[2]}")
shift
;;
-*|--*)
Expand Down Expand Up @@ -370,6 +386,10 @@ if [[ "${#colors[@]}" -eq 0 ]] ; then
colors=("${COLOR_VARIANTS[@]}")
fi

if [[ "${#lcolors[@]}" -eq 0 ]] ; then
lcolors=("${COLOR_VARIANTS[1]}")
fi

if [[ "${#sizes[@]}" -eq 0 ]] ; then
sizes=("${SIZE_VARIANTS[0]}")
fi
Expand Down Expand Up @@ -498,6 +518,54 @@ theme_tweaks() {
fi
}

uninstall_link() {
rm -rf "${HOME}/.config/gtk-4.0"/{assets,gtk.css,gtk-dark.css}
}

link_libadwaita() {
local dest="${1}"
local name="${2}"
local theme="${3}"
local lcolor="${4}"
local size="${5}"
local ctype="${6}"

local THEME_DIR="${1}/${2}${3}${4}${5}${6}"

echo -e "\nLink '$THEME_DIR/gtk-4.0' to '${HOME}/.config/gtk-4.0' for libadwaita..."

mkdir -p "${HOME}/.config/gtk-4.0"
ln -sf "${THEME_DIR}/gtk-4.0/assets" "${HOME}/.config/gtk-4.0/assets"
ln -sf "${THEME_DIR}/gtk-4.0/gtk.css" "${HOME}/.config/gtk-4.0/gtk.css"
ln -sf "${THEME_DIR}/gtk-4.0/gtk-dark.css" "${HOME}/.config/gtk-4.0/gtk-dark.css"
}

uninstall() {
local dest="${1}"
local name="${2}"
local theme="${3}"
local color="${4}"
local size="${5}"
local ctype="${6}"

local THEME_DIR="${1}/${2}${3}${4}${5}${6}"

if [[ -d "${THEME_DIR}" ]]; then
echo -e "Uninstall ${THEME_DIR}... "
rm -rf "${THEME_DIR}"
fi
}

link_theme() {
for theme in "${themes[@]}"; do
for color in "${lcolors[@]}"; do
for size in "${sizes[@]}"; do
link_libadwaita "${dest:-$DEST_DIR}" "${_name:-$THEME_NAME}" "$theme" "$color" "$size" "$ctype"
done
done
done
}

clean_theme() {
for theme in "${THEME_VARIANTS[@]}"; do
for color in '' '-light' '-dark'; do
Expand All @@ -510,6 +578,16 @@ clean_theme() {
done
}

uninstall_theme() {
for theme in "${themes[@]}"; do
for color in "${colors[@]}"; do
for size in "${sizes[@]}"; do
uninstall "${dest:-$DEST_DIR}" "${_name:-$THEME_NAME}" "$theme" "$color" "$size" "$ctype"
done
done
done
}

install_theme() {
for theme in "${themes[@]}"; do
for color in "${colors[@]}"; do
Expand All @@ -521,7 +599,20 @@ install_theme() {
done
}

clean_theme && install_package && sass_temp && gnome_shell_version && install_theme
if [[ "$uninstall" == 'true' ]]; then
if [[ "$libadwaita" == 'true' ]]; then
echo -e "\nUninstall ${HOME}/.config/gtk-4.0 links ..."
uninstall_link
else
echo && uninstall_theme && uninstall_link
fi
else
clean_theme && install_package && sass_temp && gnome_shell_version && install_theme && uninstall_link

if [[ "$libadwaita" == 'true' ]]; then
link_theme
fi
fi

echo
echo Done.
Loading

0 comments on commit e5e3e44

Please sign in to comment.