refactor
This commit is contained in:
parent
ba3718531d
commit
fc5c576a51
@ -47,7 +47,7 @@ install_theme_deps() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
install_gdm_deps() {
|
install_gdm_deps() {
|
||||||
if [[ ! "$(which glib-compile-resources 2> /dev/null)" || ! "$(which xmllint 2> /dev/null)" ]]; then
|
if ! has_command glib-compile-resources || ! has_command xmllint; then
|
||||||
echo; prompt -w "'glib2.0' 'xmllint' are required for theme installation."
|
echo; prompt -w "'glib2.0' 'xmllint' are required for theme installation."
|
||||||
|
|
||||||
if has_command zypper; then
|
if has_command zypper; then
|
||||||
@ -61,7 +61,10 @@ install_gdm_deps() {
|
|||||||
elif has_command pacman; then
|
elif has_command pacman; then
|
||||||
rootify pacman -S --noconfirm --needed glib2 libxml2
|
rootify pacman -S --noconfirm --needed glib2 libxml2
|
||||||
else
|
else
|
||||||
prompt -w "INSTRUCTION: Please make sure you have installed all of the required dependencies!"
|
prompt -w "WARNING: We're sorry, your distro isn't officially supported yet."
|
||||||
|
prompt -w "INSTRUCTION: Please make sure you have installed all of the required dependencies. We'll continue the installation in 15 seconds"
|
||||||
|
prompt -w "INSTRUCTION: Press 'ctrl'+'c' to cancel the installation if you haven't install them yet"
|
||||||
|
start_animation; sleep 15; stop_animation
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -81,7 +84,10 @@ install_beggy_deps() {
|
|||||||
elif has_command pacman; then
|
elif has_command pacman; then
|
||||||
rootify pacman -S --noconfirm --needed sassc
|
rootify pacman -S --noconfirm --needed sassc
|
||||||
else
|
else
|
||||||
prompt -w "INSTRUCTION: Please make sure you have installed all of the required dependencies!"
|
prompt -w "WARNING: We're sorry, your distro isn't officially supported yet."
|
||||||
|
prompt -w "INSTRUCTION: Please make sure you have installed all of the required dependencies. We'll continue the installation in 15 seconds"
|
||||||
|
prompt -w "INSTRUCTION: Press 'ctrl'+'c' to cancel the installation if you haven't install them yet"
|
||||||
|
start_animation; sleep 15; stop_animation
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -99,7 +105,10 @@ install_beggy_deps() {
|
|||||||
elif has_command pacman; then
|
elif has_command pacman; then
|
||||||
rootify pacman -S --noconfirm --needed imagemagick
|
rootify pacman -S --noconfirm --needed imagemagick
|
||||||
else
|
else
|
||||||
prompt -w "INSTRUCTION: Please make sure you have installed all of the required dependencies!"
|
prompt -w "WARNING: We're sorry, your distro isn't officially supported yet."
|
||||||
|
prompt -w "INSTRUCTION: Please make sure you have installed all of the required dependencies. We'll continue the installation in 15 seconds"
|
||||||
|
prompt -w "INSTRUCTION: Press 'ctrl'+'c' to cancel the installation if you haven't install them yet"
|
||||||
|
start_animation; sleep 15; stop_animation
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -119,7 +128,10 @@ install_dialog_deps() {
|
|||||||
elif has_command pacman; then
|
elif has_command pacman; then
|
||||||
rootify pacman -S --noconfirm --needed dialog
|
rootify pacman -S --noconfirm --needed dialog
|
||||||
else
|
else
|
||||||
prompt -w "INSTRUCTION: Please make sure you have installed all of the required dependencies!"
|
prompt -w "WARNING: We're sorry, your distro isn't officially supported yet."
|
||||||
|
prompt -w "INSTRUCTION: Please make sure you have installed all of the required dependencies. We'll continue the installation in 15 seconds"
|
||||||
|
prompt -w "INSTRUCTION: Press 'ctrl'+'c' to cancel the installation if you haven't install them yet"
|
||||||
|
start_animation; sleep 15; stop_animation
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -138,12 +150,14 @@ install_beggy() {
|
|||||||
blank)
|
blank)
|
||||||
cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-blank.png" "${WHITESUR_TMP_DIR}/beggy.png" ;;
|
cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-blank.png" "${WHITESUR_TMP_DIR}/beggy.png" ;;
|
||||||
default)
|
default)
|
||||||
if [[ "${no_blur}" == "false" || "${darken}" == "true" ]]; then
|
if [[ "${no_blur}" == "false" || "${darken}" == "false" ]]; then
|
||||||
install_beggy_deps && convert "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-default.png" ${CONVERT_OPT} "${WHITESUR_TMP_DIR}/beggy.png"
|
cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-blur.png" "${WHITESUR_TMP_DIR}/beggy.png"
|
||||||
elif [[ "${no_blur}" == "false" && "${darken}" == "true" ]]; then
|
elif [[ "${no_blur}" == "false" && "${darken}" == "true" ]]; then
|
||||||
cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-blur.png" "${WHITESUR_TMP_DIR}/beggy.png"
|
cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-blur-darken.png" "${WHITESUR_TMP_DIR}/beggy.png"
|
||||||
|
elif [[ "${no_blur}" == "true" && "${darken}" == "false" ]]; then
|
||||||
|
cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-default.png" "${WHITESUR_TMP_DIR}/beggy.png"
|
||||||
else
|
else
|
||||||
cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-default.png" "${WHITESUR_TMP_DIR}/beggy.png"
|
cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-darken.png" "${WHITESUR_TMP_DIR}/beggy.png"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -156,19 +170,6 @@ install_beggy() {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
install_beggy_blur() {
|
|
||||||
local CONVERT_OPT=" -scale 1280x -blur 0x35 -fill black -colorize 25% "
|
|
||||||
|
|
||||||
case "${background}" in
|
|
||||||
blank)
|
|
||||||
cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-blank.png" "${WHITESUR_TMP_DIR}/beggy-blur.png" ;;
|
|
||||||
default)
|
|
||||||
cp -r "${THEME_SRC_DIR}/assets/gnome-shell/common-assets/background-blur.png" "${WHITESUR_TMP_DIR}/beggy-blur.png" ;;
|
|
||||||
*)
|
|
||||||
install_beggy_deps && convert "${background}" ${CONVERT_OPT} "${WHITESUR_TMP_DIR}/beggy-blur.png" ;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
install_darky() {
|
install_darky() {
|
||||||
local opacity="$(destify ${1})"
|
local opacity="$(destify ${1})"
|
||||||
local theme="$(destify ${2})"
|
local theme="$(destify ${2})"
|
||||||
@ -229,7 +230,6 @@ install_shelly() {
|
|||||||
cp -r "${THEME_SRC_DIR}/assets/gnome-shell/assets${color}/"*".svg" "${TARGET_DIR}/assets"
|
cp -r "${THEME_SRC_DIR}/assets/gnome-shell/assets${color}/"*".svg" "${TARGET_DIR}/assets"
|
||||||
cp -r "${THEME_SRC_DIR}/assets/gnome-shell/activities/activities${icon}.svg" "${TARGET_DIR}/assets/activities.svg"
|
cp -r "${THEME_SRC_DIR}/assets/gnome-shell/activities/activities${icon}.svg" "${TARGET_DIR}/assets/activities.svg"
|
||||||
cp -r "${WHITESUR_TMP_DIR}/beggy.png" "${TARGET_DIR}/assets/background.png"
|
cp -r "${WHITESUR_TMP_DIR}/beggy.png" "${TARGET_DIR}/assets/background.png"
|
||||||
cp -r "${WHITESUR_TMP_DIR}/beggy-blur.png" "${TARGET_DIR}/assets/background-blur.png"
|
|
||||||
|
|
||||||
(
|
(
|
||||||
cd "${TARGET_DIR}"
|
cd "${TARGET_DIR}"
|
||||||
@ -357,11 +357,7 @@ remove_packy() {
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
install_themes() {
|
install_themes() {
|
||||||
start_animation
|
start_animation; install_beggy
|
||||||
process_ids=()
|
|
||||||
install_beggy
|
|
||||||
install_beggy_blur
|
|
||||||
cp -rf "${THEME_SRC_DIR}/sass/_gtk-base"{".scss","-temp.scss"}
|
|
||||||
|
|
||||||
for opacity in "${opacities[@]}"; do
|
for opacity in "${opacities[@]}"; do
|
||||||
for alt in "${alts[@]}"; do
|
for alt in "${alts[@]}"; do
|
||||||
@ -369,21 +365,14 @@ install_themes() {
|
|||||||
install_xfwmy "${color}"
|
install_xfwmy "${color}"
|
||||||
|
|
||||||
for color in "${colors[@]}"; do
|
for color in "${colors[@]}"; do
|
||||||
gtk_base "${color}" "${opacity}" "${theme}" "${compact}" &
|
gtk_base "${color}" "${opacity}" "${theme}" "${compact}"
|
||||||
process_ids+=("${!}") &
|
install_theemy "${color}" "${opacity}" "${alt}" "${theme}" "${icon}"
|
||||||
install_theemy "${color}" "${opacity}" "${alt}" "${theme}" "${icon}" &
|
install_shelly "${color}" "${opacity}" "${alt}" "${theme}" "${icon}"
|
||||||
process_ids+=("${!}")
|
|
||||||
|
|
||||||
gtk_base "${color}" "${opacity}" "${theme}" "${compact}" &
|
|
||||||
process_ids+=("${!}") &
|
|
||||||
install_shelly "${color}" "${opacity}" "${alt}" "${theme}" "${icon}" &
|
|
||||||
process_ids+=("${!}")
|
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
wait ${process_ids[*]} &> /dev/null
|
|
||||||
stop_animation
|
stop_animation
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -409,10 +398,10 @@ install_gdm_theme() {
|
|||||||
local TARGET=
|
local TARGET=
|
||||||
|
|
||||||
# Let's go!
|
# Let's go!
|
||||||
rm -rf "${WHITESUR_GS_DIR}"; install_beggy; install_beggy_blur
|
rm -rf "${WHITESUR_GS_DIR}"; install_beggy
|
||||||
|
gtk_base "${colors[0]}" "${opacities[0]}" "${themes[0]}"
|
||||||
|
|
||||||
if check_theme_file "${COMMON_CSS_FILE}"; then # CSS-based theme
|
if check_theme_file "${COMMON_CSS_FILE}"; then # CSS-based theme
|
||||||
gtk_base "${colors[0]}" "${opacities[0]}" "${themes[0]}" &
|
|
||||||
install_shelly "${colors[0]}" "${opacities[0]}" "${alts[0]}" "${themes[0]}" "${icon}" "${WHITESUR_GS_DIR}"
|
install_shelly "${colors[0]}" "${opacities[0]}" "${alts[0]}" "${themes[0]}" "${icon}" "${WHITESUR_GS_DIR}"
|
||||||
sed $SED_OPT "s|assets|${WHITESUR_GS_DIR}/assets|" "${WHITESUR_GS_DIR}/gnome-shell.css"
|
sed $SED_OPT "s|assets|${WHITESUR_GS_DIR}/assets|" "${WHITESUR_GS_DIR}/gnome-shell.css"
|
||||||
|
|
||||||
@ -429,11 +418,10 @@ install_gdm_theme() {
|
|||||||
# Fix previously installed WhiteSur
|
# Fix previously installed WhiteSur
|
||||||
restore_file "${ETC_CSS_FILE}"
|
restore_file "${ETC_CSS_FILE}"
|
||||||
else # GR-based theme
|
else # GR-based theme
|
||||||
gtk_base "${colors[0]}" "${opacities[0]}" "${themes[0]}" &
|
|
||||||
install_shelly "${colors[0]}" "${opacities[0]}" "${alts[0]}" "${themes[0]}" "${icon}" "${WHITESUR_TMP_DIR}/shelly"
|
install_shelly "${colors[0]}" "${opacities[0]}" "${alts[0]}" "${themes[0]}" "${icon}" "${WHITESUR_TMP_DIR}/shelly"
|
||||||
sed $SED_OPT "s|assets|resource:///org/gnome/shell/theme/assets|" "${WHITESUR_TMP_DIR}/shelly/gnome-shell.css"
|
sed $SED_OPT "s|assets|resource:///org/gnome/shell/theme/assets|" "${WHITESUR_TMP_DIR}/shelly/gnome-shell.css"
|
||||||
|
|
||||||
if check_theme_file "$POP_OS_GR_F & ILE"; then
|
if check_theme_file "$POP_OS_GR_FILE"; then
|
||||||
TARGET="${POP_OS_GR_FILE}"
|
TARGET="${POP_OS_GR_FILE}"
|
||||||
elif check_theme_file "$YARU_GR_FILE"; then
|
elif check_theme_file "$YARU_GR_FILE"; then
|
||||||
TARGET="${YARU_GR_FILE}"
|
TARGET="${YARU_GR_FILE}"
|
||||||
@ -499,7 +487,8 @@ remove_firefox_theme() {
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
install_dash_to_dock_theme() {
|
install_dash_to_dock_theme() {
|
||||||
cp -rf "${THEME_SRC_DIR}/sass/_gtk-base"{".scss","-temp.scss"}
|
gtk_base "${colors[0]}" "${opacities[0]}" "${themes[0]}"
|
||||||
|
|
||||||
if [[ -d "${DASH_TO_DOCK_DIR_HOME}" ]]; then
|
if [[ -d "${DASH_TO_DOCK_DIR_HOME}" ]]; then
|
||||||
backup_file "${DASH_TO_DOCK_DIR_HOME}/stylesheet.css" "userify"
|
backup_file "${DASH_TO_DOCK_DIR_HOME}/stylesheet.css" "userify"
|
||||||
userify sassc ${SASSC_OPT} "${DASH_TO_DOCK_SRC_DIR}/stylesheet$(destify ${colors[0]}).scss" "${DASH_TO_DOCK_DIR_HOME}/stylesheet.css"
|
userify sassc ${SASSC_OPT} "${DASH_TO_DOCK_SRC_DIR}/stylesheet$(destify ${colors[0]}).scss" "${DASH_TO_DOCK_DIR_HOME}/stylesheet.css"
|
||||||
@ -616,6 +605,7 @@ customize_theme() {
|
|||||||
|
|
||||||
if [[ "${compact}" == 'false' ]]; then
|
if [[ "${compact}" == 'false' ]]; then
|
||||||
prompt -s "Changing Definition mode to HD (Bigger font, Bigger size) ..."
|
prompt -s "Changing Definition mode to HD (Bigger font, Bigger size) ..."
|
||||||
|
#FIXME: @vince is it not implemented yet?
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 413 KiB After Width: | Height: | Size: 202 KiB |
@ -18,7 +18,6 @@
|
|||||||
<file>assets/activities.svg</file>
|
<file>assets/activities.svg</file>
|
||||||
<file>assets/view-app-grid.svg</file>
|
<file>assets/view-app-grid.svg</file>
|
||||||
<file>assets/background.png</file>
|
<file>assets/background.png</file>
|
||||||
<file>assets/background-blur.png</file>
|
|
||||||
<file>icons/scalable/actions/color-pick.svg</file>
|
<file>icons/scalable/actions/color-pick.svg</file>
|
||||||
<file>icons/scalable/status/eye-not-looking-symbolic.svg</file>
|
<file>icons/scalable/status/eye-not-looking-symbolic.svg</file>
|
||||||
<file>icons/scalable/status/eye-open-negative-filled-symbolic.svg</file>
|
<file>icons/scalable/status/eye-open-negative-filled-symbolic.svg</file>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#overviewGroup {
|
#overviewGroup {
|
||||||
background-color: rgba($osd_bg_color, 1);
|
background-color: rgba($osd_bg_color, 1);
|
||||||
background-image: url("assets/background-blur.png");
|
background-image: url("assets/background.png");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user