pull/198/head
vinceliuice 4 years ago
parent 989c2877ff
commit a38178974f

@ -0,0 +1,61 @@
#! /usr/bin/env bash
ROOT_UID=0
DEST_DIR=
# Destination directory
if [ "$UID" -eq "$ROOT_UID" ]; then
DEST_DIR="/usr/share/themes"
else
DEST_DIR="$HOME/.themes"
fi
THEME_NAME=Orchis
THEME_VARIANTS=('' '-purple' '-pink' '-red' '-orange' '-yellow' '-green' '-grey')
COLOR_VARIANTS=('' '-light' '-dark')
SIZE_VARIANTS=('' '-compact')
clean() {
local dest="$1"
local name="$2"
local theme="$3"
local color="$4"
local size="$5"
local THEME_DIR="$dest/$name$theme$color$size"
if [[ -d ${THEME_DIR} ]]; then
rm -rf ${THEME_DIR}
echo -e "Find: ${THEME_DIR} ! removing it ..."
fi
}
themes=()
colors=()
sizes=()
if [[ "${#themes[@]}" -eq 0 ]] ; then
themes=("${THEME_VARIANTS[@]}")
fi
if [[ "${#colors[@]}" -eq 0 ]] ; then
colors=("${COLOR_VARIANTS[@]}")
fi
if [[ "${#sizes[@]}" -eq 0 ]] ; then
sizes=("${SIZE_VARIANTS[@]}")
fi
clean_theme() {
for theme in "${themes[@]}"; do
for color in "${colors[@]}"; do
for size in "${sizes[@]}"; do
clean "${dest:-$DEST_DIR}" "${_name:-$THEME_NAME}" "$theme" "$color" "$size"
done
done
done
}
clean_theme
exit 0

@ -15,10 +15,9 @@ fi
SASSC_OPT="-M -t expanded"
THEME_NAME=Orchis
THEME_VARIANTS=('' '-purple' '-pink' '-red' '-orange' '-yellow' '-green' '-grey')
THEME_COLORS=('default' 'purple' 'pink' 'red' 'orange' 'yellow' 'green' 'grey')
COLOR_VARIANTS=('' '-light' '-dark')
SIZE_VARIANTS=('' '-compact')
THEME_VARIANTS=('' '-Purple' '-Pink' '-Red' '-Orange' '-Yellow' '-Green' '-Grey')
COLOR_VARIANTS=('' '-Light' '-Dark')
SIZE_VARIANTS=('' '-Compact')
# Check command availability
function has_command() {
@ -32,8 +31,8 @@ install() {
local color="$4"
local size="$5"
[[ "$color" == '-dark' ]] && local ELSE_DARK="$color"
[[ "$color" == '-light' ]] && local ELSE_LIGHT="$color"
[[ "$color" == '-Dark' ]] && local ELSE_DARK="$color"
[[ "$color" == '-Light' ]] && local ELSE_LIGHT="$color"
local THEME_DIR="$dest/$name$theme$color$size"
@ -101,10 +100,10 @@ install() {
if [[ "$tweaks" == 'true' ]]; then
sassc $SASSC_OPT "$SRC_DIR/gtk/3.0/gtk$color$size.scss" "$THEME_DIR/gtk-3.0/gtk.css"
sassc $SASSC_OPT "$SRC_DIR/gtk/3.0/gtk-dark$size.scss" "$THEME_DIR/gtk-3.0/gtk-dark.css"
sassc $SASSC_OPT "$SRC_DIR/gtk/3.0/gtk-Dark$size.scss" "$THEME_DIR/gtk-3.0/gtk-dark.css"
else
cp -r "$SRC_DIR/gtk/3.0/gtk$color$size.css" "$THEME_DIR/gtk-3.0/gtk.css"
cp -r "$SRC_DIR/gtk/3.0/gtk-dark$size.css" "$THEME_DIR/gtk-3.0/gtk-dark.css"
cp -r "$SRC_DIR/gtk/3.0/gtk-Dark$size.css" "$THEME_DIR/gtk-3.0/gtk-dark.css"
fi
mkdir -p "$THEME_DIR/gtk-4.0"
@ -113,10 +112,10 @@ install() {
if [[ "$tweaks" == 'true' ]]; then
sassc $SASSC_OPT "$SRC_DIR/gtk/4.0/gtk$color$size.scss" "$THEME_DIR/gtk-4.0/gtk.css"
sassc $SASSC_OPT "$SRC_DIR/gtk/4.0/gtk-dark$size.scss" "$THEME_DIR/gtk-4.0/gtk-dark.css"
sassc $SASSC_OPT "$SRC_DIR/gtk/4.0/gtk-Dark$size.scss" "$THEME_DIR/gtk-4.0/gtk-dark.css"
else
cp -r "$SRC_DIR/gtk/4.0/gtk$color$size.css" "$THEME_DIR/gtk-4.0/gtk.css"
cp -r "$SRC_DIR/gtk/4.0/gtk-dark$size.css" "$THEME_DIR/gtk-4.0/gtk-dark.css"
cp -r "$SRC_DIR/gtk/4.0/gtk-Dark$size.css" "$THEME_DIR/gtk-4.0/gtk-dark.css"
fi
mkdir -p "$THEME_DIR/xfwm4"
@ -211,25 +210,25 @@ install_black() {
install_theme_color() {
if [[ "$theme" != '' ]]; then
case "$theme" in
-purple)
-Purple)
theme_color='purple'
;;
-pink)
-Pink)
theme_color='pink'
;;
-red)
-Red)
theme_color='red'
;;
-orange)
-Orange)
theme_color='orange'
;;
-yellow)
-Yellow)
theme_color='yellow'
;;
-green)
-Green)
theme_color='green'
;;
-grey)
-Grey)
theme_color='grey'
;;
esac

@ -225,6 +225,8 @@ if [[ "${#sizes[@]}" -eq 0 ]] ; then
sizes=("${SIZE_VARIANTS[@]}")
fi
./clean-old-theme.sh
install_theme && link_theme
echo

@ -7,9 +7,9 @@ fi
SASSC_OPT=('-M' '-t' 'expanded')
_COLOR_VARIANTS=('' '-light' '-dark')
_GCOLOR_VARIANTS=('' '-dark')
_SIZE_VARIANTS=('' '-compact')
_COLOR_VARIANTS=('' '-Light' '-Dark')
_GCOLOR_VARIANTS=('' '-Dark')
_SIZE_VARIANTS=('' '-Compact')
if [[ -n "${COLOR_VARIANTS:-}" ]]; then
IFS=', ' read -r -a _COLOR_VARIANTS <<< "${COLOR_VARIANTS:-}"

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 291 B

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 291 B

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Before

Width:  |  Height:  |  Size: 573 B

After

Width:  |  Height:  |  Size: 573 B

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Before

Width:  |  Height:  |  Size: 419 B

After

Width:  |  Height:  |  Size: 419 B

Before

Width:  |  Height:  |  Size: 323 B

After

Width:  |  Height:  |  Size: 323 B

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Before

Width:  |  Height:  |  Size: 345 B

After

Width:  |  Height:  |  Size: 345 B

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 298 B

After

Width:  |  Height:  |  Size: 298 B

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 876 B

After

Width:  |  Height:  |  Size: 876 B

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Before

Width:  |  Height:  |  Size: 126 B

After

Width:  |  Height:  |  Size: 126 B

Before

Width:  |  Height:  |  Size: 239 B

After

Width:  |  Height:  |  Size: 239 B

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save